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: simple session question [message #175708 is a reply to message #175706] Sat, 22 October 2011 13:39 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:

> try $foo=($foo++);
>
> But actually, why not just
>
> $foo+=1;

Well, as Luuk mentioned, they are not the same. And I almost never use
the increment/decrement operators. I prefer the form $foo += 1. What I
find confusing about $foo = $foo++ is that it is not intuitively clear
what it does. The OP had certainly intended "$foo++" (just increment
$foo), but PHP interprets the construct differently. In a way which
makes sense when you think about it, but which was not obvious to me
from the start. And I am still not sure that there is no optimizer or
similar extension that would optimize this construct to a simple $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: Thu Nov 28 15:52:28 GMT 2024

Total time taken to generate the page: 0.04374 seconds