Examveda
Examveda

What will be the output of the following PHP code?
<?php
function a()
{
    function b()
    {
        echo 'I am b';
    }
    echo 'I am a';
}
a();
a();
?>

A. I am b

B. I am bI am a

C. Error

D. I am a Error

Answer: Option D

Solution(By Examveda Team)

This will be the output- I am a Fatal error: Cannot redeclare b()

This Question Belongs to PHP >> Functions

Join The Discussion

Related Questions on Functions