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

- Thread: https://externals.io/message/13826
- Original archive: https://news-web.php.net/php.internals/13826
- Started by Alan Knowles on 2004-11-12T01:54:43+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #13826 — Alan Knowles — 2004-11-12T01:54:43+00:00

URL: https://externals.io/message/13826#13826

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
