Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$x;
for ($x = -3; $x < -5; ++$x)
{
    print ++$x;
}
?>

A. -3-4-5

B. -3-4

C. infinite loop

D. no output

Answer: Option D

Solution(By Examveda Team)

The loop is not even entered as x is initially 0.

This Question Belongs to PHP >> Control Structures(Loop In PHP)

Join The Discussion

Related Questions on Control Structures(Loop in PHP)