03-02-2008, 01:28 AM
|
#13 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
They may use that approach:
php Code:
$myVar = $_GET['myVar'] ?: 'Unset';
But that raises the question of whether or not PHP should throw an undefined error in that instance, as we're not safely asking PHP if it is set. I would assume it would throw an error because I would expect it to act exactly like it would in an if statement:
If PHP decide not to throw an undefined error in the ternary, then surely questions arise as to them not being constant across the board. Although an isset would, in theory, return true in that instance, I see PHP as actually using that approach because there's no first argument any more to actually specify the value, both checking and assigning are done at once.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|