On Thu, Aug 14, 2014 at 8:26 AM, Tjerk Meesters <tjerk.meest...@gmail.com> wrote: > Hi internals, > > I was sifting through the bucket o’ bugs and found these two related issues: > https://bugs.php.net/bug.php?id=67829 > https://bugs.php.net/bug.php?id=54162 (closed) > > They concern the behaviour of the engine when a class defines no constructor > or if the class to be instantiated doesn’t exist, which can be seen here: > http://3v4l.org/jOQY0 > > This is obviously a design decision, but doesn’t seem to have a mention in > the documentation nor the spec (I couldn’t find it under the ‘new’ operator). > > I can add a paragraph in the documentation for it; the question is whether it > should also be added to the spec, seeing how HHVM and PHP behave differently > in this respect? It could be added as implementation dependent behaviour I > suppose?
This is a known behavior which is part of the VM. It is designed at http://lxr.php.net/xref/PHP_5_5/Zend/zend_vm_def.h#3383 I guess its an optimisation that prevents the compiler from compiling a ZEND_DO_FCALL for constructors, which optimizes a bit the VM path for object construction. Dmitry should have more informations. I'm +1 for a documentation or spec mention. Julien.Pauli -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php