Examveda
Examveda

What will be the output of the following PHP code ?
<?php
function TV($string)
{
  echo "my favourite TV show is ".$string;
  function b()
  {
      echo " I am here to spoil this code";
  }
}
function b()
{
  echo " I am here to spoil this code";
}
b();
TV("Sherlock");
?>

A. I am here to spoil this code

B. Error

C. My favourite TV show isI am here to spoil this code

D. None of the mentioned

Answer: Option B

Solution(By Examveda Team)

Function b is declared twice.

This Question Belongs to PHP >> Functions

Join The Discussion

Related Questions on Functions