Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76507 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42215 invoked from network); 14 Aug 2014 08:05:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2014 08:05:23 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.176 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.176 mail-vc0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:43918] helo=mail-vc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/40-40673-EBD6CE35 for ; Thu, 14 Aug 2014 04:05:20 -0400 Received: by mail-vc0-f176.google.com with SMTP id id10so972752vcb.21 for ; Thu, 14 Aug 2014 01:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=0GH1bESIBIMbJnDO151uEJHZCYQui8HcbdWH1BvTdhw=; b=bH7HhmX3GyFlTanUB/uZ/4/g7woep3+duJp40dLmxa8TRRAl457dyGQ7+kYcsK+IWe 0i4pexUAX824dCB2GsT39bLAWBQDIrxEzCiedKlG6bJbdvDHqEu6rpEY9FU/+WuOqW0k wyuq1d3f3gCLMZKBr6cSKWAI1bzLIBn+NarYzOqZHGdb/BwYxbyyK5RK0qN3OKhiuWgg VWRNw/d1d1/4+2dispRbzrsEXRlGDpKEXalL9PKyDdUvoTZfne0Nfz38DYh1dd+v/sb3 8SOutoZYrigyRFLhsgnNOP/Z9uy1LSyQJykeIRHbPEw6AslNlrONQ/oyI1k0NTf9C4Za nJLQ== X-Received: by 10.220.174.137 with SMTP id t9mr2382516vcz.12.1408003516090; Thu, 14 Aug 2014 01:05:16 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.30.70 with HTTP; Thu, 14 Aug 2014 01:04:36 -0700 (PDT) In-Reply-To: <5DCAA9AE-CC08-48BA-A0D4-78818BD5D656@gmail.com> References: <5DCAA9AE-CC08-48BA-A0D4-78818BD5D656@gmail.com> Date: Thu, 14 Aug 2014 10:04:36 +0200 X-Google-Sender-Auth: lmrAaV9lZ8dUSxJPUixuaI88Ew0 Message-ID: To: Tjerk Meesters Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Evaluation of constructor arguments if there's no constructor From: jpauli@php.net (Julien Pauli) On Thu, Aug 14, 2014 at 8:26 AM, Tjerk Meesters wrote: > Hi internals, > > I was sifting through the bucket o=E2=80=99 bugs and found these two rela= ted issues: > https://bugs.php.net/bug.php?id=3D67829 > https://bugs.php.net/bug.php?id=3D54162 (closed) > > They concern the behaviour of the engine when a class defines no construc= tor or if the class to be instantiated doesn=E2=80=99t exist, which can be = seen here: http://3v4l.org/jOQY0 > > This is obviously a design decision, but doesn=E2=80=99t seem to have a m= ention in the documentation nor the spec (I couldn=E2=80=99t find it under = the =E2=80=98new=E2=80=99 operator). > > I can add a paragraph in the documentation for it; the question is whethe= r it should also be added to the spec, seeing how HHVM and PHP behave diffe= rently in this respect? It could be added as implementation dependent behav= iour 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