?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
Answer & Solution
Correct Answer:
Option
C
This will be the output- Fatal error: Call to undefined function b(). You cannot call a function which is inside a function without calling the outside function.
Join the Discussion
Login to post a comment or share your explanation.
Login