Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97763 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28610 invoked from network); 15 Jan 2017 17:35:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2017 17:35:04 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:37985] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/8E-00729-5C2BB785 for ; Sun, 15 Jan 2017 12:35:02 -0500 Received: by mail-wm0-f41.google.com with SMTP id r144so143204676wme.1 for ; Sun, 15 Jan 2017 09:35:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=GgxuObrkIITeXbW4Aq8byzZ7gP09c5fVyRVPwQ8BHIk=; b=a7kng2ZnQ7LfSwZofNqkc+r3sBSF4oiiMxtYHTp1gBd/T52v7SMmpzH8KPtYSE6mbF 9mrKJVIhrawXrApcnAy/sV78BJzQuzzxEM0B6iq11YCbDdZW1W2YmVg6yZXyGZpmfVhq JLVKuBx9Ix8NiyCCBOrr2bDFcGTEO665lq71wmAfVT4FU4OeQfd5pxf7zMCku6I5rkDM 5sAsYpyWqBP+gVJVvDB/biIfYHIbPA4ziY06HIBcgAvQlqupDaaKiOY0qGxSSEWLAIP8 VO8v5oDWIHP4vNgxSup208Snd++h1i7iPp4lhhQY5+MJpNv6wV7qu5NTDbkDcyJh5hyL 68GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=GgxuObrkIITeXbW4Aq8byzZ7gP09c5fVyRVPwQ8BHIk=; b=XCJSwxmS1U/GTL6NCQI8v1533HT6NzYZwdAsnt2uoBjUcRk8jdFS4YWN+Ep4LSGT9s FLPlNB4O9KlFcUIPYWo/KZffbWX+XWB2caJpKC9bJxzRJ7NIRkHD65iko0RHCjAbZ8lA 5o/Yggl9k1KI46kd8vJQRSMc3QmjBLhAwfTeN2jN3XwfLjBqUVM5TjYx47diUdLjlu9C qIJY/R9L0JQvU9ejBQw2DEk/mwrHjfBTYkEutfbX2Vtx5aYz806CpEF9VFB7je+RZ9gv mwlUCMVaMcPUjenPK7hW05T8VQ8ptJGVN7bcwkC0LkEdlxI6c9ygcj8WRdTWb05VM07T wjLg== X-Gm-Message-State: AIkVDXJTjb4oF/1XsBG5VQCIUJraDRO8hdB+Gdv/o3+VqvLWU8Uz7U4UWsNenRQ0D0cG7w== X-Received: by 10.223.174.73 with SMTP id u9mr19574733wrd.159.1484501698574; Sun, 15 Jan 2017 09:34:58 -0800 (PST) Received: from ?IPv6:2a00:23c4:4bd2:6e00:c490:1f7c:b8b0:93cd? ([2a00:23c4:4bd2:6e00:c490:1f7c:b8b0:93cd]) by smtp.googlemail.com with ESMTPSA id c132sm16915095wme.21.2017.01.15.09.34.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Jan 2017 09:34:57 -0800 (PST) To: internals@lists.php.net References: <0DE25BF8-D349-48EF-A83B-8837DD4AD1E0@gmail.com> <5efcc230-c67b-4439-cc82-b31eacbf36db@php.net> <7c8c8801-a849-6fd2-91e9-954030c55e83@fleshgrinder.com> <2051639b-1b63-2e44-51b0-381caa54dfd0@fleshgrinder.com> Message-ID: <17bb5ec4-833d-d827-0932-390723d52665@gmail.com> Date: Sun, 15 Jan 2017 17:34:55 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Explicit constructor call and polymorphic dispatch From: rowan.collins@gmail.com (Rowan Collins) On 14/01/2017 14:58, Giovanni Giacobbi wrote: > If you go for blocking explicit calls to __construct() (i'm personally in > favour of it), i hope you would change the syntax for its only legitimate > use which is calling the parent's constructor within a constructor, so how > about something like parent(...)? > It would be ugly to say "You are not supposed to explicit call > __construct() *ever*" and then "You know what, to initialize parent class > you need to call __construct()". This is actually a very good point: if you ban calls to __construct, you need syntax for not only calling the parent constructor, but other constructors in the chain. For instance [https://3v4l.org/jTsek]: __get($bar) directly? If so, why is that more legitimate than $foo->__construct? And if not, do you allow parent::__get($bar), or do you insist on that using different syntax as well? (If you think the answers are easy for __get, pick a different magic method and ask the same questions). These exceptions and special cases are going to proliferate, and all to stop a hypothetical "misuse" of the language. Do you have an example of a bug you've seen where a user acting reasonably would have been saved by this new prohibition? Regards, -- Rowan Collins [IMSoP]