View Single Post
Old 08-17-2008, 03:31 AM   #4 (permalink)
Theo
The Wanderer
 
Join Date: Aug 2008
Posts: 11
Thanks: 4
Theo is on a distinguished road
Default

Think of it like maths - everything in brackets gets evaluated first i.e.

PHP Code:
10
* (4) = 14 
In the same way the expression in brackets gets evaluated before being compared to $list_type. Since neither 'category' or 'versions' evaluate to false, the result of ('categories' || 'versions') is true. This is what then gets compared to $list_type.

Edit:

I would read it as:

IF variable NOT EQUAL TO (string OR string)

in the same way as you, but I would see that:

(string OR string) == true

since everything in brackets gets evaluated first.

Last edited by Theo : 08-17-2008 at 04:38 AM. Reason: Clarification
Theo is offline  
Reply With Quote