Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$i = 0;
$x = $i++; $y = ++$i;
print $x; print $y; 
?>

A. 02

B. 12

C. 01

D. 21

Answer: Option A

Solution(By Examveda Team)

First case i is incremented after setting x to i.

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

Join The Discussion

Related Questions on Operators and Expressions in php