Re: bitwise operations and Unicode strings

From: Date: Tue, 29 May 2007 19:04:53 +0000
Subject: Re: bitwise operations and Unicode strings
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-29881@lists.php.net to get a copy of this message
Hello Antony, so depending on the operator I either have no types or strict typing even though I cannot see/know what I have? That is far from KISS. best regards marcus Tuesday, May 29, 2007, 5:37:55 PM, you wrote: > On 29.05.2007 19:30, Richard Quadling wrote: >> As PHP is loosely typed, "1"==1 is fine. > Right, but that's not true for bitwise operators. > Try this: > <?php > $a = 111; > $a |= 50; > var_dump($a); ?>> > and this > <?php > $a = "111"; > $a |= "50"; > var_dump($a); ?>> > OR is applied to _characters_ of the string. > Hence I can see no reason to support it at all. >> Is it that with Unicode, this looseness is gone? > Nope. > -- > Wbr, > Antony Dovgal Best regards, Marcus

« previous php.internals (#29881) next »