Simple question, simple code. This works:
$x = &$_SESSION['foo'];
This does not:
$x = (isset($_SESSION['foo']))?&$_SESSION['foo']:false;
It throws PHP Parse error: syntax error, unexpected '&'
. Is it just not possible to pass by reference while using the conditional operator, and why not? Also happens if there's a space between the ?
and &
.