I don't think we should support bitwise ops on Unicode strings. I am not even sure why we support them for normal strings.

-Andrei


On May 29, 2007, at 2:25 AM, Antony Dovgal wrote:

Hello.

Do you think the engine should support bitwise operators and Unicode strings?
If yes, how do you think it should work?

Example:
<?php
$a = "1"; $a|="2"; var_dump($a);
?>

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.

There are several possible ways to implement it:
1) the same as with native strings - apply the operator to each element of the string separately; 2) convert the string to binary (using say iso-8859-1) and then see 1);

We can also leave it as is (since it doesn't seem very useful) or even drop the native strings support (it doesn't seem very useful to me either).
Opinions?

--
Wbr, Antony Dovgal

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to