Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$auth = 1;
$status = 1;
if ($result = (($auth == 1) && ($status != 0)))
{
    print "result is $result";
}
?>

A. result is true

B. result is 1

C. error

D. no output

Answer: Option B

Solution(By Examveda Team)

Result is x&&y which returns 1 if both x and y are true.

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

Join The Discussion

Related Questions on Operators and Expressions in php