PHP sucks dick through a straw
chromatic at wgz.org
Fri Jan 12 20:23:45 GMT 2007
On Friday 12 January 2007 11:50, Uri Guttman wrote:
> how could you make them work if the AUTOLOAD decides on the fly whether
> to support a method or not? AUTOLOAD has to do the method work itself
> and it does not have an api just for testing if a method exists. you
> could write an AUTOLOAD that even checks its args as to whether to
> implement a method or die and can() will never be able to work around
> that. AUTOLOAD would need another api which is called by can() so it can
> return true/false there. maybe call it AUTOEXISTS :).
Fun fact: can() is a method. You can override methods in Perl!
I presume anyone smart enough to write code in AUTOLOAD() which knows which
methods to support is smart enough to figure out how to share that same logic
with a custom can() method -- and no special magic 5.9.5-or-later ad-hoc
additional API necessary.
More information about the london.pm