FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » simple session question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: OT: and even in Dart .........Re: simple session question [message #175719 is a reply to message #175718] Sat, 22 October 2011 17:34 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
Luuk schrieb:
> i did send a bug-report:
> https://bugs.php.net/bug.php?id=60114

I do not see any bug here. I was confused because it's a crappy way to
code, but it's clear why it works the way it does:

$foo = 0;
$foo = $foo++;

is definitely identical to

$foo = 0;
$foo = ($foo++);

since ++ has higher precedence than =. In fact, ($foo = $foo)++ does
rightfully throw a parse error, since you can only increment a variable,
not an expression.

As mentioned before in this thread, the above code is equivalent to

$foo = 0;
$tmp = $foo; // $foo++ yields the previous value, which is 0
$foo = $foo + 1; // then $foo is incremented...
$foo = $tmp; // ...and then re-assigned the old value

It's the exact same procedure as it would be with $foo = $bar++.

Greetings,
Thomas

--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: session cookie: client side
Next Topic: by get this format my explode file name like this through php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 14:43:20 GMT 2024

Total time taken to generate the page: 0.05860 seconds