Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79086 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26128 invoked from network); 21 Nov 2014 16:22:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Nov 2014 16:22:59 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wg0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:53028] helo=mail-wg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/00-26013-1E66F645 for ; Fri, 21 Nov 2014 11:22:58 -0500 Received: by mail-wg0-f53.google.com with SMTP id l18so6927341wgh.40 for ; Fri, 21 Nov 2014 08:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TIb1Z4Z3P42KPcLXO6S5vUTEgk7iJRx3MNemXx3yCMg=; b=L/OvAvWq1G4p1BWUDbOeCHwwyUP3uqS/2q42xlnoBC0O7eF4ltKvorICN2SdMr+v7d sDu6qA9u2NVGX2stq4nU7eqvY7z+NRGVM/vc7W0p6qN0F6Lu6rQl+SiFSLdKcXPO6CkG 0KYnbQJYthtZiLLT9/1B7TqS9tKJC931bxTtGp+OMkSJnbThQ6QjqK4wofbVuqZwPHKj f45mWIf4OmgcYRFM3DyFABM3wgqP8/F5LMGwWfywK02ly8uvEOCwtcMBwPoa1PSKOy8F 7zbcdvh/+Dk90TXYGh0UZ0ES0A8UlZluM0j241HzY3k3S5bP0aQJlOZdnXrJHdDUUX6P 2Reg== MIME-Version: 1.0 X-Received: by 10.194.52.68 with SMTP id r4mr9302807wjo.82.1416586969735; Fri, 21 Nov 2014 08:22:49 -0800 (PST) Received: by 10.27.10.4 with HTTP; Fri, 21 Nov 2014 08:22:49 -0800 (PST) In-Reply-To: References: Date: Fri, 21 Nov 2014 17:22:49 +0100 Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary=047d7b8742cc1fec77050860db86 Subject: Re: [PHP-DEV] [RFC] Remove PHP 4 Constructors From: nikita.ppv@gmail.com (Nikita Popov) --047d7b8742cc1fec77050860db86 Content-Type: text/plain; charset=UTF-8 On Wed, Nov 19, 2014 at 12:11 AM, Levi Morrison wrote: > 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 > I'm +1 on this RFC. I've lost count of the number of times I had to debug some "completely impossible" behavior I got while writing quick testing code (which is obviously not namespaced), because I accidentally created a class "Test" with a method "test" or similar. I'm also pretty confident that we can provide robust tooling for automatically porting code to new constructors - including updating parent:: call references if need be. Don't see how that would be a particular issue here. Nikita --047d7b8742cc1fec77050860db86--