Julien Pauli wrote (on 14/08/2014):
It may be possible to interpret the argument, but I think it will need
new OPCodes, like ZEND_NEW_WITH_CTOR and ZEND_NEW_WITHOUT_CTOR , and a
compiler patch to support those.
This may be thought for PHP7, and I think will benefit from the
ast-compiler RFC if its voted.
Yeah, to clarify, I was definitely thinking in terms of PHP7, where lots
is already being done for consistency and parser changes.
It may be naive of me, but would it be possible to simply add an
implicit constructor with an empty argument list and body to any class
which doesn't have one?
Because that's kind of what seems logical from the user point of view:
class A { }
==
class A { public function __construct() {} }
The same could also be achieved by having an implicit ancestor of all
objects, because an empty constructor (and destructor) could be defined
there, then over-ridden by whatever the user declares.
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php