Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code ?
    <?php
    function fun($str)
    {
    echo "favourite fun time is ".$str;
    function b()
    {
    echo "Inside block executed...";
    }
    }
    function p()
    {
    echo "Outside block executed...";
    }
    p();
    ?>
    1. favourite fun time is
    2. Inside block executed...
    3. Outside block executed...
    4. Error
    5. None of these
Correct Option: C

This one works because p is declared independent of fun() also.



Your comments will be displayed only after manual approval.