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 #175751 is a reply to message #175750] Sun, 23 October 2011 08:40 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
Tim Streater wrote:
> In article <j7vhmk$420$1(at)news(dot)albasani(dot)net>,
> Thomas Mlynarczyk <thomas(at)mlynarczyk-webdesign(dot)de> wrote:
>
>> Norman Peelman schrieb:
>>
>>> $foo = 0;
>>> $foo = $foo++;
>>>> It should be equivalent to:
>>>> $foo = 0; // 0
>>> $foo = $foo; // 0 = 0
>>> $foo = $foo + 1; // 0 = (0 + 1)
>>
>> No. What you are doing here is assigning first and then incrementing.
>> The evaluation of $foo++ returns 0 and increments $foo as a side
>> effect. This evaluation process must be completed before the
>> assignment can happen:
>>
>> [1] Evaluate the expression $foo++ (result: 0, side effect: $foo = 1)
>> [2] Assign the result to $foo ($foo = 0)
>>
>>> $foo++ means that the variable is to be incremented after the
>> variable > is accessed.
>>
>> Yes, it means that the expression $foo++ evaluates to the value which
>> $foo had before. And it is this value which is assigned to $foo after
>> the $foo++ step is completed.
>
> Yes - as per my JavaScript example. If I say:
>
> results[i++];
>
> I get the value of results[i]. That value is held in limbo to be
> assigned to the LHS. Then the post-increment occurs. Then the result
> from limbo is assigned to LHS.
>
> And so with PHP. Which will mean that:
>
> $foo = $foo++;
> $foo = ($foo++);
>
> both act the same and set $foo to 0.
>
First I heard that []===().....
[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 02:23:20 GMT 2024

Total time taken to generate the page: 0.07357 seconds