> -----Original Message-----
> From: Antony Dovgal [mailto:[EMAIL PROTECTED]
> Sent: 30 May 2007 09:21
> To: [EMAIL PROTECTED]
> Cc: php-dev
> Subject: Re: [PHP-DEV] bitwise operations and Unicode strings
>
> On 30.05.2007 04:15, Richard Lynch wrote:
> >> This code outputs "3" in native mode and "Fatal error: Unsupported
> >> operand types" in Unicode mode.
> >> I believe this is an inconsistency and it should be
> possible to use
> >> Unicode strings there.
> >
> > Given that there are probably a bazillion PHP scripts written by
> > newbies just like that, I'd have to say it's crucial for
> wide-spread
> > Unicode adoption for it to "just work"
>
> No, I'd say there might be like ten scripts on the planet
> relying on bitwise operations with strings, since numeric
> strings behaviour is different here.
I'd say more. Pear::Crypt_HMAC, for instance, does.
/* Calculate the padded keys and save them */
$this->_ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64));
$this->_opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64));
Jared
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php