Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code ?
    <?php
    function fun($str)
    {
    echo "my favourite fun time is ".$str;
    function m()
    {
    echo " to spend with friends";
    }
    }
    m();
    ?>
    1. my favourite fun time is
    2. Nothing
    3. to spend with friends
    4. Error
    5. my favourite fun time is to spend with friends
Correct Option: D

m is undeclared if fun() is not called first.



Your comments will be displayed only after manual approval.