Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114289 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60602 invoked from network); 7 May 2021 01:38:05 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 7 May 2021 01:38:05 -0000 To: internals@lists.php.net References: Date: Thu, 6 May 2021 20:44:45 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m20wAhXCT4xkaeAI3b6kkAg2rePeygiUZ" X-Posted-By: 96.61.105.82 Subject: Re: [PHP-DEV] PR for minor bugfix in compact() From: ramsey@php.net (Ben Ramsey) Message-ID: --m20wAhXCT4xkaeAI3b6kkAg2rePeygiUZ Content-Type: multipart/mixed; boundary="lY3KIOItxPgFTDdJDdTjRbGPDY2uXKHMU"; protected-headers="v1" From: Ben Ramsey Newsgroups: php.internals Subject: Re: [PHP-DEV] PR for minor bugfix in compact() References: In-Reply-To: --lY3KIOItxPgFTDdJDdTjRbGPDY2uXKHMU Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 4/28/21 06:17, G. P. B. wrote: > On Wed, 28 Apr 2021 at 12:12, David Gebler wrot= e: >=20 >> Hi internals, >> I've opened a PR to cause compact() to throw a TypeError if its parame= ters >> are not valid, which I consider to be a fix for what is effectively a = bug >> whereby logical errors in user code can be silently swallowed. >> >> GPB has done an initial review and left a comment >> https://github.com/php/php-src/pull/6921#pullrequestreview-646848902 i= n >> which he suggests I open this up to the floor, so here it is, seeking >> your feedback kindly. Also if anyone can clarify what is meant by a wa= rning >> "will be promoted in PHP 9", I am not familiar with what changes are >> planned for the next major version? >> >> Regards >> David >> >=20 > Hey David, >=20 > What I meant is that we usually don't introduce an exception without pr= ior > warning to existing functionality. > So making this a Warning in the PHP 8 series which gets promoted to a > TypeError in PHP 9, > similarly to how most of the internal functions went from returning nul= l + > warning to throwing a TypeError, > or many of the warnings that got promoted to ValueErrors in 8.0 because= > it's a major release. >=20 > Personally I don't mind introducing the TypeError immediately in PHP 8.= 1, > because compact() should be rather rare > and mostly used on an array, but others might feel differently about th= is. >=20 > Best regards, >=20 > George P. Banyard >=20 Does anyone have any thoughts or concerns about this being in 8.1? I'm=20 trying to decide whether to merge the PR, and I'd like to make sure=20 anyone who wants to speak up has a chance to do so. Cheers, Ben --lY3KIOItxPgFTDdJDdTjRbGPDY2uXKHMU-- --m20wAhXCT4xkaeAI3b6kkAg2rePeygiUZ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEObZBND2MEEsrFG3D+cOdwLlphUQFAmCUm40FAwAAAAAACgkQ+cOdwLlphUT8 fg/9Gm23Wab09PZ14X36KhAGpp73rsRKZuDJLbcFTOJFeYiXYtBFY9Jbaw+OyO98XohJCEq2C+qG 6XtC1Mad9RVSf1r1YEOAARj11b8pXDFvY+owCgwPFNVwhw/eJVS2DKnKaYDORHDujo6R7LuWnl8A uJjC7Q2bqEGYhHBcPy3o5Oir3Bt6k3gD5xudaofm6e35xSKK6njWt8SFLQLqcjOXZ00rWvwofnG5 8lrbVol/JAIw6sUyYuHGKZLWdxFCjhlFhelt/F40Atl/SxDTQKUQZBOT6bwfcytf0yvrPjh4QFub NAM1pgyHz7FeeFPFdivjw/5rWhA21zfO4M7P/M2OQTAh9wfhAq5iIctIFsP0CuUjl91GlPJsXAfa +WTeID4FLi9RWeboG1zzXlWaqCDnf+MzlWnW1G3D7xUAbfo4NtNthHoegdSt68cgKQP7njGPCN8X KSPT1iiB4QgP9Rulp5D7suOIZ/JDKLwV0aNEV94+dWUkjYkYlkBh4j9PFREv0EYlV1cXSt34kqe+ F5zfTYDGmAceRPWAu4fEyvG7TWaOO9wn9ef1LyNKfRfYtdZT69Ht9xxSv37LMwchHFOPO13g8AfL 49PdT6z5hX/3rfYkbPcpOhqy37htoPjZqNlBVHd7Vd83T6F+5ekhDzm/tteS0E1ZwrU1F6PpLjKI iN8= =IHgW -----END PGP SIGNATURE----- --m20wAhXCT4xkaeAI3b6kkAg2rePeygiUZ--