Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93682 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79529 invoked from network); 1 Jun 2016 17:30:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2016 17:30:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.89 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.89 mx108.easyname.com Received: from [77.244.243.89] ([77.244.243.89:50421] helo=mx204.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/92-63812-0CB1F475 for ; Wed, 01 Jun 2016 13:30:41 -0400 Received: from cable-81-173-133-15.netcologne.de ([81.173.133.15] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b89yX-0000aE-Rp; Wed, 01 Jun 2016 17:30:38 +0000 Reply-To: internals@lists.php.net References: <1228b754-6687-bba2-d251-a8d8586ac107@gmail.com> To: Rowan Collins , internals@lists.php.net Message-ID: Date: Wed, 1 Jun 2016 19:30:27 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <1228b754-6687-bba2-d251-a8d8586ac107@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="P6Clg9L2AwAXojPCgiGnWSf0TVncfaWmF" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC] Replace "Missing argument" warning with "Too few arguments" exception From: php@fleshgrinder.com (Fleshgrinder) --P6Clg9L2AwAXojPCgiGnWSf0TVncfaWmF Content-Type: multipart/mixed; boundary="C8Uktr0R8OOfQpGvbpWN1bPgeQOsqKwiC" From: Fleshgrinder Reply-To: internals@lists.php.net To: Rowan Collins , internals@lists.php.net Message-ID: Subject: Re: [PHP-DEV] [RFC] Replace "Missing argument" warning with "Too few arguments" exception References: <1228b754-6687-bba2-d251-a8d8586ac107@gmail.com> In-Reply-To: <1228b754-6687-bba2-d251-a8d8586ac107@gmail.com> --C8Uktr0R8OOfQpGvbpWN1bPgeQOsqKwiC Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/1/2016 1:33 PM, Rowan Collins wrote: > I like the concept behind this, but I worry it might have a rather larg= e > BC impact. Like removing call-time pass-by-reference, there may be a lo= t > of long-untouched code that needs fixing to work within this constraint= =2E > I'm not even sure how easy it would be for static analysis to identify > these cases. I guess on the flip-side, people will *probably* have > Warnings displayed or logged already... >=20 > The RFC would also benefit from more discussion of the current behaviou= r > in different cases: >=20 > function foo($a) {} > foo(); // Warning >=20 > function bar(A $a) {} > bar(); // Error >=20 > function baz(A $a=3Dnull) {} > baz(); // OK >=20 > function quux(?A $a) {} > quux(); // Not sure. Error? >=20 > function wibble(int $a) {} > wibble(); // Error (regardless of strict_types, I think) >=20 > function wobble(?int $a) {} > wobble(); // Error? >=20 > Any other cases? >=20 > Certainly, making these consistent would be nice, but like a lot of > consistency, does it come at too high a price? >=20 I fully agree with Rowan here. First we need a proper plan for all these cases and a consistent behavior. Next we need to discuss if something like this can be introduced in a feature release or requires a major release. Note that func_get_args() should die too since we have variadic arguments now. However, this can only be introduced in a major version. (Correct me if I am wrong and didn't thought of a very common use case that requires func_get_args(). I for one never need it.) Whether references need to die completely or not is a more complicated discussion. There are valid use cases for them. However, they should be avoided and other solutions should be preferred if possible. --=20 Richard "Fleshgrinder" Fussenegger --C8Uktr0R8OOfQpGvbpWN1bPgeQOsqKwiC-- --P6Clg9L2AwAXojPCgiGnWSf0TVncfaWmF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXTxuzAAoJEOKkKcqFPVVrJpIP/1PxDuml7W/IskrDCqI8tG2+ WYPCx6Fk7zQ9MK+WpIEZNp0q3mRsMDWRpZzsRB3kIQETO22pGmcIJ//WrIGZDMzo fXupN6FWD3e1W4iDhbiJZwJXyVNPXw/q8YiiM9Pm3F8BK2FjyjHEhP/rk23Oqmj6 yCPiCpG6Rck1FT8OpPwz/sdmCGo/HN8kPJDB2xGufG3OxLAXz50U7NbbKfF/pKs2 HiZX9qxNU6sCpMIEp1Q9JVT739Ujpb42wkcuL9KQ7D22dXnR+9kCCSz7335Y5Ysa JgTrKL0uxKn+ILEIwBux04mdLC0jJdC28Ytp410raasdgTcipzQ9G/ZTMRBU3jJ4 1QzfTnOFh5N9NXoHnx64YeNbVIorX5+87HN6yrs/hwf+bBsfk8Vv299gDvbHMLGn RrqEHiGCQT+kApG8Cbqe8CX4GVBbgF+aJJ+TXGZ6N4gos7D3Dg4WrxvXwYd+eJN9 Zg3T5RAWUk1gWn/4M/50lrY0RJHjai4hH4pScziPRODLmeheE77uMDYfpWIYa23T zy9oNbxy04jeNspbeM0fRTPV1RXdMTRRD3aW+fdAJeyI9D/nrIjv0MPVaejTm5EG +8YEMAEjyGlKWqEg+Da72EXtraW3IKz1dw0Bj6Ul1ar4H1F21vu7TebqXkr4T+Ue 6Kg7bArsw1Z7/vI+l91z =xa10 -----END PGP SIGNATURE----- --P6Clg9L2AwAXojPCgiGnWSf0TVncfaWmF--