Re: [citations for] Re: [PHP-DEV] Experiments with a threading library for Zend: spawning a new executor
| From: | Stas Malyshev | Date: | Thu, 20 Jan 2011 00:19:47 +0000 |
| Subject: | Re: [citations for] Re: [PHP-DEV] Experiments with a threading library for Zend: spawning a new executor | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51333@lists.php.net to get a copy of this message | ||
Hi!
Many PHP features should be language constructs, but they were made as language hacks. __construct is evil, as like any other language hackConstructors are standard feature in many languages. There's nothing evil in them.
class Client {
function __construct() {
// some code
parent::__construct(); // as good client call the super class
// and then more code
}
}
Arguably, initialization is the part of the API, but I see your point - it might be useful to supply all objects with empty default ctor so that parent::__construct() always works. Submit a feature request to bugs.php.net.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227