Is it possible to define a function that get's called when a object isn't defined? So I can do $makeUpOntheFlyObjectNames->something();
in the function get the object name, and the function name and a array of it's arguments, or a empty array if it has none. For what it was trying to call? Had an idea to make stuff like $varName->length();
work in V5.x for strings and stuff. Was trying to Google this but was getting stuff like class_exists
and stuff back, so figured a human would have a better answer. But I don't think it's possible, just wanted to check here to be sure.
So if the object wasn't found, and was calling length, check if it's a string and then return the result of strlen, else if it's not a string emulate php's own error.. Just some idea I had, but not sure if the first part of detection is even possible.