Is it possible to define a variable in an IF condition, and then use that variable in the same IF condition? My test shows it cannot, however, why it isn't possible escapes me. If so, how? If not, why?
function getX(){return 123;}
function getY($x){return $x*2;}
function getZ($y){return $y*2;}
if(
true
&& $x=getX()
&& $y=getY($x)
&& $z=getZ($y)
)
{echo('true '.$x.' '.$y.' '.$z);}
else {echo('false '.$x);}