Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code ?
    <?php
    function fun($str)
    {
    echo "hello\n".$str;
    function Z()
    {
    echo "Inside block executed...\n";
    }
    }
    function Z()
    {
    echo "Outside block executed...\n";
    }
    Z();
    fun("Interview Mania");
    ?>
    1. Error
    2. Inside block executed...
    3. Outside block executed...
    4. Interview Mania
    5. None of these
Correct Option: A

Function Z is declared twice.



Your comments will be displayed only after manual approval.