Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99133 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20490 invoked from network); 23 May 2017 20:22:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2017 20:22:18 -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 212.232.28.122 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.122 mx201.easyname.com Received: from [212.232.28.122] ([212.232.28.122:55609] helo=mx201.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/03-10292-7F994295 for ; Tue, 23 May 2017 16:22:16 -0400 Received: from cable-81-173-132-37.netcologne.de ([81.173.132.37] 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 1dDGJm-0008Mw-A4; Tue, 23 May 2017 20:22:12 +0000 Reply-To: internals@lists.php.net References: To: Nikita Popov , Rasmus Schultz Cc: PHP internals Message-ID: <48a8b061-0e40-876b-4daa-75cff0018f9b@fleshgrinder.com> Date: Tue, 23 May 2017 22:22:05 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="beEQK9dbOtaOtlJPBInv6DuvWm0ne8DiQ" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] Parameter type widening RFC From: php@fleshgrinder.com (Fleshgrinder) --beEQK9dbOtaOtlJPBInv6DuvWm0ne8DiQ Content-Type: multipart/mixed; boundary="gjBnRgI7L0ho94H77r8COoi9CeJsRUAIA"; protected-headers="v1" From: Fleshgrinder Reply-To: internals@lists.php.net To: Nikita Popov , Rasmus Schultz Cc: PHP internals Message-ID: <48a8b061-0e40-876b-4daa-75cff0018f9b@fleshgrinder.com> Subject: Re: [PHP-DEV] Parameter type widening RFC References: In-Reply-To: --gjBnRgI7L0ho94H77r8COoi9CeJsRUAIA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/23/2017 9:51 PM, Nikita Popov wrote: > One of the primary motivations behind this RFC is to allow the addition= of > typehints (for example in library code) without introducing a backwards= > compatibility break for any code implementing or extending your > interface/class. Requiring an explicit "mixed" or "any" type would not > allow this. I think this is 95% of the reason for this RFC, so without = it, > the change itself is probably not worthwhile. >=20 Yeah, I remember that and it is actually one of the very first sentences in the RFC: > Implementing this RFC would allow libraries to be upgraded to use > type declarations in their method signatures. Currently adding types > to a method of a class in a library would break any code that extends > that class. > > --- https://wiki.php.net/rfc/parameter-no-type-variance This was/is a great feature for library developers. We should probably add Rasmus' concern to the list of things that can be added in PHP 8. Another possible approach here could be to enforce an explicit "mixed" if "strict_types" are active for the declaring class. --=20 Richard "Fleshgrinder" Fussenegger --gjBnRgI7L0ho94H77r8COoi9CeJsRUAIA-- --beEQK9dbOtaOtlJPBInv6DuvWm0ne8DiQ 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 iQIcBAEBCAAGBQJZJJnuAAoJEOKkKcqFPVVria0P/2jm+6UGl+4sTYWhEWQSOoJj YLQmXb1U5R1qzyy6J/NdcNa1cHsp7mUBWNXaqF/bCW9SBFT6eIzHLTHPzhP0EzGb oS/Q+umMgponc7aEdeEByeqPNjago4nK0fMNynQi85HnhCiDNldyL7SyNL7cmlx4 LvmTx1Ttjxp/F8uSqRZiNkgk1ze/eXkzlamW3T73WMvZVUWF3EEJGAv40d8xG6fq ibMPlZ0KG2JZdq3z/03UV8/wnmSu+sA6Nyi91dzSMF3DSErB4d3Q+q8VAZlcN4je azVUHwCBij4uixLJiEXfSw7zveVg5oU4LhOqNwO7J2dOCLypWWymzD7VxvnhzIkd 32im6cxmafWXyg5E3CUKxi5tG2pc+Uc9tmNwinXaxZNor9i0A6iAKwjq4UU/yorB JJGlhvora1YRz/Qie6trGgagNMKJ7fljM7GA092EBt9j1ijuoJC0hndfcCIg9tGx KfFc1gpkgZd4y56ZuDA9oygnb+L7WuJVcksQNC+3jUl8mEfUBRH+Hrfpt9r00aiC LZZpuO49/JvODyUylVHZH+htiKhGqbZN7mdTBlohc2cHAb4DYX+WaO2ZMXDuaJ7x 9XRFCLbpnKGwGaKMkCK6kSnnAu0TWJC9lpJY4vb/ioYWViZuq9dl3ptKUi2xsuE0 8Kp5jCXbMm5MzdZE3455 =oRxT -----END PGP SIGNATURE----- --beEQK9dbOtaOtlJPBInv6DuvWm0ne8DiQ--