×

Multiple-Choice Questions

Web Technologies MCQs

Computer Science Subjects MCQs

Databases MCQs

Programming MCQs

Testing Software MCQs

Digital Marketing Subjects MCQs

Cloud Computing Softwares MCQs

AI/ML Subjects MCQs

Engineering Subjects MCQs

Office Related Programs MCQs

Management MCQs

More

What will be the output of the following PHP code (2)?

19. What will be the output of the following PHP code?

<?php
function myFunction()
{
    $x = 5;
    echo "Result1: $x , ";
}
myFunction();
echo "Result2: $x";
?>
  1. Result1: 5 , Result2:
  2. Result1: 5 , Result2: 0
  3. Result1: 5 , Result2: 5
  4. None of the above

Answer: A) Result1: 5 , Result2:

Explanation:

The variable x is a local scope, and can only be accessed within that function.

Comments and Discussions!

Load comments ↻




Copyright © 2025 www.includehelp.com. All rights reserved.