Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-20 Thread Andi Gutmans
Guys, please take this offlist. Undefined means undefined. There's no assumed way of it working. Andi At 07:14 AM 1/20/2006, Carl P. Corliss wrote: Jon Dowland wrote: On Thu, Jan 19, 2006 at 06:41:17PM +0200, Marco Kaiser wrote: Today during a session i had a strange "magic" feature found i

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-20 Thread Carl P. Corliss
Jon Dowland wrote: On Thu, Jan 19, 2006 at 06:41:17PM +0200, Marco Kaiser wrote: Today during a session i had a strange "magic" feature found in php. this works perfect as expected. it returns 22. Odd, I expected 21: echo (11 + 10) a = a + 1 nope - discounting the 'unde

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-20 Thread Jon Dowland
On Thu, Jan 19, 2006 at 06:41:17PM +0200, Marco Kaiser wrote: > Today during a session i had a strange "magic" feature found in php. > > $a = 10; > echo ++$a + $a++; > ?> > > this works perfect as expected. it returns 22. Odd, I expected 21: echo (11 + 10) a = a + 1 -- Jon Dow

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-19 Thread Marco Kaiser
Sorry Jani, i mean a reference (alias) :) -- Marco 2006/1/19, Jani Taskinen <[EMAIL PROTECTED]>: > > > For the 2nd time: references ARE NOT POINTERS! :-p > > --Jani > > > On Thu, 19 Jan 2006, Marco Kaiser wrote: > > > Hmm yes i know this, > > but its very interesting for me to see how

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-19 Thread Jani Taskinen
For the 2nd time: references ARE NOT POINTERS! :-p --Jani On Thu, 19 Jan 2006, Marco Kaiser wrote: Hmm yes i know this, but its very interesting for me to see how php internaly handles ++$a with a pointer. Now i understand it :) -- Marco 2006/1/19, Marcus Boerger <[EMAIL PROTECTED]

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-19 Thread Marco Kaiser
Hmm yes i know this, but its very interesting for me to see how php internaly handles ++$a with a pointer. Now i understand it :) -- Marco 2006/1/19, Marcus Boerger <[EMAIL PROTECTED]>: > > Hello Marco, > > though Hartmut is perfectly correct in his statement here's what > happens: > > $a = 10;

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-19 Thread Marcus Boerger
Hello Marco, though Hartmut is perfectly correct in his statement here's what happens: $a = 10; // 10 ++$a // 11 $a + $a // 22 $a++ // 23 Thursday, January 19, 2006, 5:41:17 PM, you wrote: > Today during a session i had a strange "magic" feature found in php. > $a = 10; > echo ++$a

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-19 Thread Christian Schneider
Etienne Kneuss wrote: Notice that this behavior can be reproduced using only prefix increment operators. Is that also expected to give undefined results ? Yes, see - Chris -- PHP Internals - PHP Runtime Development Mailing List To un

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-19 Thread Etienne Kneuss
Notice that this behavior can be reproduced using only prefix increment operators. Is that also expected to give undefined results ? Best regards Hartmut Holzgraefe a écrit : > Marco Kaiser wrote: >> Today during a session i had a strange "magic" feature found in php. >> >> > $a = 10; >> e

Re: [PHP-DEV] 23 nothing is so as it seems, but why

2006-01-19 Thread Hartmut Holzgraefe
Marco Kaiser wrote: Today during a session i had a strange "magic" feature found in php. there is a very simple rule that PHP inherited from C: never use pre- and postfix increment operators in the same expression as the results are undefined -- Hartmut Holzgraefe, Senior Support Enginee