Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Appendices : Migrating from PHP/FI 2 to PHP 3 : Short-circuited boolean evaluation

Short-circuited boolean evaluation

In PHP 3.0 boolean evaluation is short-circuited. This means that in an expression like (1 || test_me()), the function test_me() would not be executed since nothing can change the result of the expression after the 1.

This is a minor compatibility issue, but may cause unexpected side-effects.

Code Examples / Notes » migration.booleval

php

"Short-circuiting" is often called "lazy evaluation," too.

Change Language


Follow Navioo On Twitter
About the incompatibilities in 3.0
old_function
Start/end tags
if..endif syntax
while syntax
Expression types
Error messages have changed
Short-circuited boolean evaluation
Function TRUE/FALSE return values
Other incompatibilities
eXTReMe Tracker