Re: [PHP-DEV] bitwise operations and Unicode strings

2007-06-15 Thread Andrei Zmievski
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 th

RE: [PHP-DEV] bitwise operations and Unicode strings

2007-05-30 Thread Jared Williams
> -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: > >> Thi

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-30 Thread Antony Dovgal
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 b

RE: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Andi Gutmans
I'd go with (2) for BC sake and as breaking BC here would have very little value in the first place. Andi > -Original Message- > From: Antony Dovgal [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 29, 2007 2:26 AM > To: php-dev > Subject: [PHP-DEV] bitwise operations and Unicode strings

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Richard Lynch
On Tue, May 29, 2007 4: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: > $a = "1"; > $a|="2"; > var_dump($a); > ?> > > This code outputs "3" in native mode and "Fatal

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Antony Dovgal
On 29.05.2007 23:04, Marcus Boerger wrote: 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. You should have told that to the person who wrote this code, not me. And I believe you're at least 7

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Stanislav Malyshev
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. Using bitwise operators on string is far from anything, so I see no real way to make it obvious, since the operation itself is very non-obvious. -- Stanislav

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Marcus Boerger
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"

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Richard Quadling
As PHP is loosely typed, "1"==1 is fine. Is it that with Unicode, this looseness is gone? On 29/05/07, Pierre <[EMAIL PROTECTED]> wrote: Hi, On 5/29/07, David Coallier <[EMAIL PROTECTED]> wrote: > On 5/29/07, Antony Dovgal <[EMAIL PROTECTED]> wrote: > > Hello. > > > > Do you think the engine

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Antony Dovgal
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: $a = 111; $a |= 50; var_dump($a); ?> and this $a = "111"; $a |= "50"; var_dump($a); ?> OR is applied to _characters_ of the string. Hence I

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread Pierre
Hi, On 5/29/07, David Coallier <[EMAIL PROTECTED]> wrote: On 5/29/07, Antony Dovgal <[EMAIL PROTECTED]> wrote: > Hello. > > Do you think the engine should support bitwise operators and Unicode strings? > If yes, how do you think it should work? > > Example: > $a = "1"; > $a|="2"; > var_dump($a)

Re: [PHP-DEV] bitwise operations and Unicode strings

2007-05-29 Thread David Coallier
On 5/29/07, Antony Dovgal <[EMAIL PROTECTED]> wrote: Hello. Do you think the engine should support bitwise operators and Unicode strings? If yes, how do you think it should work? Example: This code outputs "3" in native mode and "Fatal error: Unsupported operand types" in Unicode mode. I bel