Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65418 invoked from network); 11 Mar 2015 00:31:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2015 00:31:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.182 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.182 mail-pd0-f182.google.com Received: from [209.85.192.182] ([209.85.192.182:43308] helo=mail-pd0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/70-59305-4FC8FF45 for ; Tue, 10 Mar 2015 19:31:48 -0500 Received: by pdjp10 with SMTP id p10so6375527pdj.10 for ; Tue, 10 Mar 2015 17:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=dtUDBRj3FBFImP1M92aqrFporTuq1Fcl2FW5D8wwCOs=; b=A2xggHmB5Ul0v+gHDCLCqb6T8Q5D5ixLcoZjGmDrlyxPuIHPwfuHcPyn6/F7/nvKHC ZYoFYS2x+fiS7UUMsdttMVasNaDW5Qlb+/BWWvX1n71IS3RQ2wopUUR0CHXYob14oW8J I6ZtUv9wYcBL4+w51GvFdbBEDGLwvh9IE/yD2hzxA0wKvkHKhgITT9d2yRTqD0y3pMEI 5uKXb76EX5+UDaX8uxN0t0Gi1lBlrgh9ZZRJgYqQB3Sx/1POP8XwgZFfVDU5WWjo5qED FUHU+9HHd3g8mmdoGedZ5ZgALA4kQoESvPpyNYVVesVi3D51kM4zHikn0G1DrwraEehG LaWQ== X-Received: by 10.70.123.131 with SMTP id ma3mr43022590pdb.16.1426033904940; Tue, 10 Mar 2015 17:31:44 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id x1sm2967118pdr.17.2015.03.10.17.31.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 17:31:43 -0700 (PDT) Message-ID: <54FF8CED.5030701@gmail.com> Date: Tue, 10 Mar 2015 17:31:41 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: marcio3w@gmail.com, PHP internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > - Even if you already read the RFC in the past, read it again now. > - Don't claim **possible** massive BC breaks before read the > measurements already done. No matter how seasoned you are with PHP, real > numbers matter most than assumptions. Your measurements are welcome too. I'd say your own data - 4597 warnings on 27 different cases of calls - is quite fitting the "massive BC break" category. If I had some app and had to evaluate the upgrade to PHP 7 and would see that it produces thousands of errors and I have to patch dozens of separate places to fix it (your data doesn't say if the sources of the calls are the same, so I take the best interpretation - that both source and target are the same) - I would postpone the upgrade as far as possible, because it looks like a huge disruption. Additionally, ZF2 tests couldn't even run - and from this you conclude that your patch is fine. I conclude that we already have a big problem, and making it worse is not a good idea. If we do it couple of more times, we'd probably get people to run PHP 7 somewhere in 2025. Additionally, I feel bad about magic features that change depending on which code is inside the function. That doesn't feel like a good design. Additionally, there is more than variadic functions which may use extra parameters. Such as dynamic dispatch: function getVariables($vars, $arg) { foreach($vars as $var) { $getter = "get$var"; $result[] = $this->$getter($arg); } return $result; } grossly simplified of course. Now imagine some getters need the arg and some don't. I can't write this code anymore without either: 1. Adding argument to all getters even though they don't need it (unclean and confusing) 2. Checking how many arguments each getter needs and modifying the loop accordingly (even more confusing) > - Try the patch. Really. > - Consider reading the use case present on this post: goo.gl/3ykdIy The case you bring there looks artificially constructed to support this RFC. If your unit tests are so bad as to not actually check that the functions like createUser() do actually create the user you asked to create and don't just drop information on the floor, and your code refactoring practices are so bad as to allow people just drop arguments from public APIs and replace them with other arguments, and all this without checks or typing - parameter counts is not what is going to save you. Your own example would break if both changes are done at the same time (if you can do either of them, no reason why you can't do both). -- Stas Malyshev smalyshev@gmail.com