note 15476 deleted from language.expressions by tularis

From: Date: Tue, 12 Oct 2004 14:02:50 +0000
Subject: note 15476 deleted from language.expressions by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-78414@lists.php.net to get a copy of this message
Note Submitter: tmacamNOSP at Mufc dot br ---- As reported previously, PHP boolean operators seem to short-circuit. What if you want them to do not short-circuit? Exemple: $result_of = f1() and f2() and f3() suppose you want to run f3 even when f1 already returned false. If you perform some silly tests such as: echo true + true; you'll see that indeed, true=1 and false=0 and true+true = 2 (ok. this _is_ silly!) Anyway, the point is: you could use * (multiplication) instead of 'and', to get a not short-circuiting 'and' and + (sum) to get a not short-circuiting or. []s MaCa

« previous php.notes (#78414) next »