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 #175735 is a reply to message #175729] Sat, 22 October 2011 23:22 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
The Natural Philosopher schrieb:

> The point is that bracketing is supposed to absolutely ensure that
> nothing outside gets done till the inside is complete.

And that's exactly what happens:

// $foo = 0;
[1] Evaluate 0 // result: 0
[2] Assign result of [1] to $foo // $foo = 0
// $foo = ($foo++);
[3] Evaluate operation "post-increment" on $foo // ($foo++)
[3.1] Set return value to current $foo // result: 0
[3.2] Add 1 to $foo // $foo = 1
[3.3] Return result // 0
[4] Assign result of [3] to $foo // $foo = 0

Thus, for a few nanoseconds, $foo is indeed 1, until this increment is
undone in [4] by reassigning $foo its old value.

> So $a=($foo++); should be the same as
> $foo++;
> $a=$foo;

No. That would be $a = ++$foo.

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: Sun Dec 22 08:27:53 GMT 2024

Total time taken to generate the page: 0.04089 seconds