Re: constructor hook

From: Date: Tue, 18 Sep 2012 15:08:41 +0000
Subject: Re: constructor hook
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-63062@lists.php.net to get a copy of this message
Hello Rasmus! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RS> Hey, RS> I wonder if it would make sense to have a way to globally hook into RS> __construct() - sort of like how you can hook into the autoloaders with RS> spl_autoload_register() ... RS> This could be useful for things like dependency injection and debugging. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Programming language should have a clear behavior. But here is too much magic. Usually, DI objects are not created in a vacuum. They require a factory... may be service locator. Like this: http://snipt.org/vLae1/Traditional -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Regards, Edmond -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

« previous php.internals (#63062) next »