I'd say this is more of a brackets issue : if (($node = node_load($nid)) && $node->parent) {} should work the way you expect yched Bèr Kessels a ecrit le 16/07/2006 17:15:
Op zondag 16 juli 2006 16:53, schreef Bèr Kessels:
As I can hardly beleive that I am the first to bump into this: Am I missing an obvious point? Is there an issue for this if it really is like this?
It seems I am wrong. And I am flabbergasted. But my problem is solved. Somehow some odd 'feature' in PHP does not allow you to check for items in trhe same if. if ($node = node_load($nid) && $node->parent) {} evaluates false, while a nested IF evaluates as expected. if ($node = node_load($nid)) { if ($node->parent) {} }
Guess I completely misunderstood the evaluation in PHP :p
Bèr