Re: [PHP] Boolean Assignment Operator

2009-02-02 Thread Gavin Hodge
t 12:26 AM, Edmund Hertle wrote: > 2009/2/2 Robert Cummings >> >> On Tue, 2009-02-03 at 00:07 +1100, Gavin Hodge wrote: >> > In Java / C# / C, >> > $bool &= $anotherBool; >> > is shorthand for >> > $bool = $bool & $anotherBool; >> &

Re: [PHP] Boolean Assignment Operator

2009-02-02 Thread Gavin Hodge
In Java / C# / C, $bool &= $anotherBool; is shorthand for $bool = $bool & $anotherBool; So &= forces a reference assignment? On Tue, Feb 3, 2009 at 12:03 AM, Edmund Hertle wrote: > 2009/2/2 Gavin Hodge >> >> Hi, >> >> I'm fairly new to PHP, havin

[PHP] Boolean Assignment Operator

2009-02-02 Thread Gavin Hodge
Hi, I'm fairly new to PHP, having migrated from the Java / C# world. I wrote some code similar to the following: $success = true; $success &= operation1(); $success &= operation2(); if ($success === true) { operation3(); // depends on 1 and 2 being successful } This didn't work as expected