Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79052 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25746 invoked from network); 20 Nov 2014 21:30:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2014 21:30:48 -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.43 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wg0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:57954] helo=mail-wg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/40-23592-78D5E645 for ; Thu, 20 Nov 2014 16:30:48 -0500 Received: by mail-wg0-f43.google.com with SMTP id l18so4859669wgh.30 for ; Thu, 20 Nov 2014 13:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to:cc :message-id; bh=wDYetSHdoYyp6Tm0fnpLsJykxXyUjDcsDamkVY8FAoQ=; b=Bwm22doCvGOtZy8fuV30z160psiDIuhhjf0bBRt6HRfmLIeDS0A/b31Y3r3Tc74VOf 8gW9BYwGviNV4a91uFt16k1vX8hwv2VT/FojzVrce7xCKnrDHR+82F+J6TiiYMyHtyZO eUwxXs4ILaBFz4KNGTgjaIRRHGVIBiHG7hHiR1ElLqPQWS8MquEC4v9RYCupZN5JefuI Eggi1+t+eO/k1nZEv8Xq1DpPeSuUc4eR05FnvlLYy4lsqis/T+uiYoZAmhSY78AeyxnF iVT5OV2E/OgrSLmXjc4IiS+wTnV3K3TokJkg4TKITxrJJgvhG50epK7AYXI5jvt0ibg0 4AXQ== X-Received: by 10.180.107.193 with SMTP id he1mr1486612wib.27.1416519043403; Thu, 20 Nov 2014 13:30:43 -0800 (PST) Received: from [192.168.0.3] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id cr6sm5082192wjb.44.2014.11.20.13.30.42 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Nov 2014 13:30:42 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: References: <546C9E22.6090301@fedoraproject.org> <20141119134632.GV2294@phcomp.co.uk> <546CA8C0.1060707@gmail.com> <20141119143329.GX2294@phcomp.co.uk> <1416476628.15061.4.camel@kuechenschabe> <1416502819.15061.38.camel@kuechenschabe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Thu, 20 Nov 2014 21:29:32 +0000 To: Levi Morrison ,=?ISO-8859-1?Q?Johannes_Schl=FCter?= CC: Alain Williams ,internals Message-ID: Subject: Re: [PHP-DEV] [RFC] Remove PHP 4 Constructors From: rowan.collins@gmail.com (Rowan Collins) On 20 November 2014 20:54:00 GMT, Levi Morrison wrote: >>> I just want to make sure I understand you correctly: you are saying >>> you are voting no on this RFC because a tool, which is not part of >>> this RFC but we kindly provide, doesn't detect when a certain thing >is >>> called? >> >> It is a non-trivial change. Fixing this is not always as some people >> might suggest. > >1) Identify PHP 4 constructors using one of several tools (including >upgrading to PHP 5.7 and getting E_DEPRECATEDs). >2) Use one of the several tools that support method rename refactoring >(Netbeans, PhpStorm, and others) to rename the methods to __construct. > >You could probably automate it with a very high degree of success; I >just don't want to automatically change code for liability reasons. I >think you are exaggerating the required work given the tools we have >at our disposal… The problem is that the constructor is part of the public API (for inheritance purposes) so the required refactoring is not necessarily isolated to one project, or even doable by one developer. The maintainer of the library must first release a version with the new constructors in place, and the consumer of the library must then audit their code for anything relying on the old constructor. Supporting various combinations of PHP 5/7, old/new lib, and old/new consumer code is then messy at best. I agree that it's perfectly doable, but it's not as easy to migrate as, say, a syntax change.