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

Home » Imported messages » comp.lang.php » out of sheer curiosity...
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: out of sheer curiosity... [message #177571 is a reply to message #177565] Tue, 10 April 2012 10:43 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
Jerry Stuckle schrieb:

> Objects NEVER persist between different HTTP requests. By definition,
> HTTP is a transactional environment and at the end of the request any
> objects are destroyed.

True. But since we do need objects to persist, we invent things like
sessions and serialization so our scripts can *pretend* they persist and
will never know the difference.

> Objects by definition have state and behavior. Only the state can
> persist between transactions; behavior never can - which is why objects
> need to be reconstructed.

Behaviour is "the methods". And they surely persist since the source
files are not destroyed after each request. All instances of a class
share the same methods, after all.

> Both __construct() and __clone() are types of constructors. __wakeup()
> is not (unless you consider sleep() to be a destructor - see above).

Why do you keep insisting that I must consider __sleep() to be a
destructor if I consider __wakeup() to be a constructor?

Consider:

1) __sleep() is called before the corresponding __wakeup() -- by your
logic this would mean the destructor is called before the constructor

2) __sleep() is called on a different object than the corresponding
__wakeup() -- so it cannot be the destructor corresponding to __wakeup()

3) __sleep() does not destroy anything. On the contrary, it helps to
preserve something. It is therefore not a destructor.

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
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: 5.4 windows installer.
Next Topic: Does PHP5 treat $_SERVER['PHP_AUTH_USER']) differently?
Goto Forum:
  

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

Current Time: Fri Nov 22 14:03:12 GMT 2024

Total time taken to generate the page: 0.04321 seconds