<?php
$x;
echo "$x";
?>
Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
143
Questions
4/8
Page
Pick an option on a question to see the right answer and solution.
<?php
$x;
echo "$x";
?>
Select an option to see the answer and solution.
<?php
$x = 5;
{
$x = 10;
echo "$x";
}
echo "$x";
?>
Select an option to see the answer and solution.
<?php
$x = 5;
{
echo "$x";
}
?>
Select an option to see the answer and solution.
<?php
$x = 5;
function fun()
{
echo "$x";
}
fun();
?>
Select an option to see the answer and solution.
<?php
$x = 5;
function fun()
{
$x = 10;
echo "$x";
}
fun();
echo "$x";
?>
Select an option to see the answer and solution.
<?php
$x = 5;
function fun()
{
$x = 10;
echo "$x";
}
fun();
echo "$x";
?>
Select an option to see the answer and solution.
<?php
$x = 4;
$y = 3;
function fun(y = 4)
{
x+y+$x;
echo "$z";
}
echo $x;
echo $y;
echo $z;
fun(y);
?>
Select an option to see the answer and solution.
<?php
$x =4;
$y = 3;
function fun(y)
{
x + y + $x;
echo "$z";
}
echo $x;
echo $y;
echo $z;
fun(3, 4);
?>
Select an option to see the answer and solution.
<?php
function fun(y)
{
$x = 4;
$y = 3;
x + y + $x;
echo "$z";
}
fun(3, 4);
?>
Select an option to see the answer and solution.
<?php
$x = 3, 4, 5, 6;
echo "$x";
?>
Select an option to see the answer and solution.
<?php
$a = 10;
$b = 4;
$c = fun(10,4);
function fun(b)
{
$b = 3;
return b + a;
}
echo $a;
echo $b;
echo $c;
?>
Select an option to see the answer and solution.
<?php
winner";
looser";
echo b;
?>
Select an option to see the answer and solution.
<?php
winner";
looser";
echo b;
?>
Select an option to see the answer and solution.
<?php
winner";
looser";
echo b;
?>
Select an option to see the answer and solution.
<?php
$x = 5;
$y = 10;
function fun()
{
GLOBALS['x'] + $GLOBALS['y'];
}
fun();
echo $y;
?>
Select an option to see the answer and solution.
<?php
$x = 5;
$y = 10;
function fun()
{
GLOBALS['x'] + $GLOBALS['y'];
}
fun();
echo $y;
?>
Select an option to see the answer and solution.
<?php
function fun()
{
$x = 0;
echo $x;
$x++;
}
fun();
fun();
fun();
?>
Select an option to see the answer and solution.
<?php
function fun()
{
static $x = 0;
echo $x;
$x++;
}
fun();
fun();
fun();
?>
Select an option to see the answer and solution.
<?php
static $x = 0;
function fun()
{
echo $x;
$x++;
}
fun();
fun();
fun();
?>
Select an option to see the answer and solution.
<?php
$x=0;
function fun()
{
echo $GLOBALS['x'];
$GLOBALS['x']++;
}
fun();
fun();
fun();
?>
Select an option to see the answer and solution.