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 #177597 is a reply to message #177596] Tue, 10 April 2012 16:33 Go to previous messageGo to previous message
Leonardo Azpurua is currently offline  Leonardo Azpurua
Messages: 46
Registered: December 2010
Karma:
Member
"Jerry Stuckle" <jstucklex(at)attglobal(dot)net> escribió en el mensaje
news:jm1mku$hqm$3(at)dont-email(dot)me...
>
> If you want to call __wakeup() a constructor, then you need to call
> __sleep() a destructor. You can't have it both ways.

Hi,

That would be if I had an obssesive love for symmetry, which is not the case
:-)

I don't care much about terms.

PHP lacks polymorphic constructors (a limitation which, after several years
using the best available OO practices with VB6, I can perfectly cope with).
So, if you need an alternate way to fill an object's data members, then
__wakeup seems to come in very handy.

With __construct(<args>), you initialize -i.e. fill data members and create
the appropriate internal states- the object from args.

With __wakeup you know you have your top level data members initialized
(from a previous state), so you have to rebuild the apropriate internal
states.

I have no problem at all with that. It may not be symmetric (but, again, who
cares?), but it is precisely documented and it works as expected (I guess,
since I have had no experience at all with PHP serialization).

--
[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: Thu Nov 28 11:06:39 GMT 2024

Total time taken to generate the page: 0.04308 seconds