Re: bitwise operations and Unicode strings

From: Date: Tue, 29 May 2007 15:37:55 +0000
Subject: Re: bitwise operations and Unicode strings
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-29872@lists.php.net to get a copy of this message
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

« previous php.internals (#29872) next »