I know about questions like this one. There are lots of them with great answers.
I know this was "fixed" in PHP 5.5.x
, but I'm unfortunately I'm using 5.3.x
.
$iHatePHP = $node->get($key);
if (isset($node->get($key)) ...
The error I get:
Fatal error: Can't use method return value in write context in ...
I know the "fix" is to put the result of get()
into a variable and call isset()
on that. However, in order to save writing that thousands of times in my code, is it equivalent or am I missing some cases?
$iHatePHP = $node->get($key);
if (!($node->get($key)) ...
Edit: I control get()
. So I can make it return anything I like, such as NULL
, FALSE
or ""