[RFC] Remove PHP 4 Constructors

From: Date: Tue, 18 Nov 2014 23:11:17 +0000
Subject: [RFC] Remove PHP 4 Constructors
Groups: php.internals 
Request: Send a blank email to internals+get-78969@lists.php.net to get a copy of this message
Dear Internals, I am proposing an RFC[1] to remove PHP 4 constructors in PHP 7. If accepted, methods with the same name as their defining class will no longer be recognized as constructors. As noted in the RFC, there are already many situations where we do not recognize these methods as constructors, such as in namespaces and traits and when `function __construct` is also present. Andrea Faulds has kindly written a utility that identifies when a PHP 4 constructor is defined[2]. It does not automatically change the code for liability reasons. The utility PHPMD[3] can also detect this but has a false positive when __construct is also defined. Cheers, Levi Morrison [1]: https://wiki.php.net/rfc/remove_php4_constructors [2]: https://github.com/TazeTSchnitzel/PHP4_Constructor_Finder [3]: http://phpmd.org/rules/naming.html#constructorwithnameasenclosingclass

« previous php.internals (#78969) next »