PHP5 __call() now requires __sleep/wakeup() ?

php.internals

Alan Knowles

21 years ago
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