PHP: Short-circuited boolean evaluation - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Function TRUE/FALSE return values Error messages have changed

Last updated: Sat, 27 Jan 2007

view this page in

# 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.

add a note User Contributed Notes
Short-circuited boolean evaluation
php at cotest dot com
17-Jul-2002 11:13
`"Short-circuiting" is often called "lazy evaluation," too.`
add a note
Function TRUE/FALSE return values Error messages have changed

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST