Php Objective Questions with Answers for written test exams 3

Question 3
What will the following script output?


$a = 1;

$a = $a— + 1;

echo $a;

?>

A. 2

B. 1

C. 3

D. 0

E. Null
Answers 3


Answer A is correct.The expression $a— will be evaluated after the expression $a

= $a + 1 but before the assignment.Therefore, by the time $a + 1 is assigned to

$a, the increment will simply be lost.

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---