PHP5 __call() now requires __sleep/wakeup() ?
| From: | Alan Knowles | Date: | Fri, 12 Nov 2004 01:54:43 +0000 |
| Subject: | PHP5 __call() now requires __sleep/wakeup() ? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-13826@lists.php.net to get a copy of this message | ||
I got a message the other day, saying that my overloaded classes in PHP5 where not serializing.
It appears that because PHP4 __call(), could return null to indicate that the function did not exist, a class without __sleep worked ok.
However for PHP5, as __sleep is not defined, __call is sent the call, and just ignores it.
i guess it's probably unfixable, but it's a big gotcha now.
Possible fixes however
a) dont call __call(), on magic methods?
b) add a __call_not_handled() function or something to tell the processer that __call doesnt handle it..
c) leave as is?
Regards
Alan