Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$x = 0;
function fun()
{
    echo $GLOBALS['x'];
    $x++;
}
fun();
fun();
fun();
?>

A. 000

B. 012

C. Nothing

D. Error

Answer: Option A

Solution(By Examveda Team)

This question is similar to question 6.

This Question Belongs to PHP >> Operators And Expressions In Php

Join The Discussion

Related Questions on Operators and Expressions in php