note 52329 deleted from language.oop5.reflection by danbrown
| From: | danbrown@php.net | Date: | Wed, 16 Sep 2009 16:19:12 +0000 |
| Subject: | note 52329 deleted from language.oop5.reflection by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160724@lists.php.net to get a copy of this message | ||
Note Submitter: walter dot huijbers at gmail dot com
----
The wonderfull example code of russ collier works great until using it in combination with an
interface or another abstract class, wich forces to define a function or variable in the loadable
dynamic class, and the loaded class doesn't implement all the abstract functions. Ofcourse the
class should not be used and an error should be reported, but the reported error is a Fatal error
and is impossible to catch. This way it is impossible to, for example, generate an error message
displaying the name of the file from wich the class is loaded.
Having dynamicly loadable classes with a forced interface can be very usefull when working on big
projects or giving third parties the ability to provide new plugins. Considering this (imho) it
would be nice to provide a clean error message to the writer of the plugin.
Please correct me if I'm wrong.