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 #175741 is a reply to message #175727] Sun, 23 October 2011 00:12 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
Richard Damon schrieb:

> I suspect that there is a difference between the execution model of
> C/C++ and PHP here, do in part to the fact that C/C++ is (normally) a
> compiled language with the goal of allowing the compiler to generate as
> efficient of code as possible, while PHP is designed as a interpreted
> language.

Hm. But PHP is written in C, so I would assume it to just follow C here.

> x = x; /* perform the = */
> x = x+1; /* perform the ++ */

That could be further optimized by dropping the x = x. But here the
assignment seems to have a higher precedence than the increment.

> temp = x;
> x = x+1;
> ... do what ever with temp
>
> Which being an interpreted language makes some sense, why put off doing
> something, and recording somewhere that you need to do it, when you can
> do it now, the possible savings that C might have been able to make, get
> swamped by the other overhead in PHP.

Now I wonder why x = x++ is undefined in C. If it was defined to be a no
op as it behaves in PHP, then it could be optimized away completely.

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:41:37 GMT 2024

Total time taken to generate the page: 0.06543 seconds