Just gotta love theory... Why aren't these two stmts doing the same thing? |
[eluser]WanWizard[/eluser]
No, OR is a boolean operator. So when PHP evaluates this line, it will convert both elements of the statement to boolean, if needed. Now, isset() already returns a boolean. '' is a string, and an empty string evaluates to FALSE (see this for an explanation). Your statement therefore translates to: Code: $prefix = isset($config['_prefix']) OR FALSE; |
Messages In This Thread |
Just gotta love theory... Why aren't these two stmts doing the same thing? - by El Forum - 10-24-2010, 01:36 PM
Just gotta love theory... Why aren't these two stmts doing the same thing? - by El Forum - 10-24-2010, 02:22 PM
Just gotta love theory... Why aren't these two stmts doing the same thing? - by El Forum - 10-24-2010, 02:38 PM
Just gotta love theory... Why aren't these two stmts doing the same thing? - by El Forum - 10-24-2010, 02:44 PM
Just gotta love theory... Why aren't these two stmts doing the same thing? - by El Forum - 10-24-2010, 02:49 PM
|