Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93796 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54082 invoked from network); 5 Jun 2016 07:24:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2016 07:24:50 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; 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:52537] helo=mx203.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/81-29296-FB3D3575 for ; Sun, 05 Jun 2016 03:24:50 -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 1b9SQO-0001x6-17; Sun, 05 Jun 2016 07:24:44 +0000 Reply-To: internals@lists.php.net References: <94009625-535b-d937-21b6-b454f942a82d@gmail.com> To: Stanislav Malyshev , Rasmus Schultz Cc: PHP internals Message-ID: Date: Sun, 5 Jun 2016 09:24:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Iu2aLqALtEKOqtjTuHAmIx5iTsNSoUxhD" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof From: php@fleshgrinder.com (Fleshgrinder) --Iu2aLqALtEKOqtjTuHAmIx5iTsNSoUxhD Content-Type: multipart/mixed; boundary="joOHPsmbem3P1DeIuOTB5DGCIPr2RnpH0" From: Fleshgrinder Reply-To: internals@lists.php.net To: Stanislav Malyshev , Rasmus Schultz Cc: PHP internals Message-ID: Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof References: <94009625-535b-d937-21b6-b454f942a82d@gmail.com> In-Reply-To: --joOHPsmbem3P1DeIuOTB5DGCIPr2RnpH0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/5/2016 12:36 AM, Stanislav Malyshev wrote: > Why it should match scalar types? You can't use output of this function= > in a scalar type in any way. >=20 To avoid those WTF moments and make it easier for newcomers. On 6/5/2016 12:36 AM, Stanislav Malyshev wrote: > So let's add more of it by having multiple functions that do exactly th= e > same thing but name null and float differently. >=20 The RFC contains the deprecation and removal of gettype as a non optional vote. You are completely right that introducing new stuff and more new stuff is the wrong way to go. We need to clean up too. On 6/5/2016 12:36 AM, Stanislav Malyshev wrote: > If you think people would want to edit gigabytes of existing code > because you want NULL to be lowercase, you are very seriously mistaken > about the order of priority of an average PHP developer. I am sure > 99.9999% of people care about all this pedantry infinitely less than > they care about their code keeping working and their development not be= > impeded by things like having to read the manual each time to choose > which two of almost identical functions they need now and which of them= > has null in which case. >=20 I doubt that anybody relies on gettype to determine such things. They use is_null($x) and $x =3D=3D null or $x =3D=3D=3D null. Anyone who relie= s on a function that had for years a warning in the manual that one should not rely on the returned string value or debugging/error output to stay consistent is doing something EXTREMELY wrong. On 6/5/2016 12:36 AM, Stanislav Malyshev wrote: > I think constantly disrupting the language environment by pedantic > tweaks that add BC and cognitive load but do not actually enable > anything new, just move things around - is not only confusing, but > harmful for the whole ecosystem. >=20 This is the very nature of refactoring. Make things better without changing its functionality. However, in this case we even have a change of functionality. On 6/5/2016 12:36 AM, Stanislav Malyshev wrote: > And if "NULL" really confuses you to the point you have no idea what it= > means - well, really, I don't know what to say. >=20 Thanks for reducing my first contribution to this single tiny change that is part of it. I am sure it will attract more people to contribute to php-internals. :P (No worries, you don't scare me away, harharhar.) --=20 Richard "Fleshgrinder" Fussenegger --joOHPsmbem3P1DeIuOTB5DGCIPr2RnpH0-- --Iu2aLqALtEKOqtjTuHAmIx5iTsNSoUxhD 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 iQIcBAEBCAAGBQJXU9O0AAoJEOKkKcqFPVVrJoYP/2O0n6UZKloiL9Hev5wXUZ8h iwi2syQ71LCzlu2JMuwZjYzcdC67sqxSjQ7WcyCuNj+0DExxdvuO0l8mnKgImtSx pd4lJRsBsAcYbfMy7rRuoavdrir6nNPnojtNzxyCIcGhg23t31RE8DMR/vMyNftP lGzjgFHEBfQoHgvxEDnLmeG+Nmm5A68Z7tPDFclqipXSvOrlwUwYdpn2OBrEUAAT VcKH1orRc0JrNYqM7TzLs80epQ+eGzjRQKGg1CGmjpJTGauJVyVpphAqWjZ6ATzB PmwkgU0XyY7FImtU6D4MTn3BegsOVyyTvJYZwjnDsRmXSwXl/2CUzHge3uZGNV4v l19b+NP5NNmubY2ZTR8H8cAXJdqrSsBx55IJMWcmcuvY0Pjstq/uGlpo5q9uAzRu ap8SwrHuzKAMNUCQpWLnC45Bw2V5P9U26twtYh/0qdCklkgm3D12Dsi+1MBtF/4v jmEtFFkzHBQB96b22ojIhaBH1oXjCYIN5x463uc2PbuoUStXO3PZtqpkdnE3g6k+ hlXfEG3PrVPwuRpL/w0J8MTpvqzJ5FlQ4lzWe3gIbNwUNtNOxMTg2FWLaP/pqbk3 X7aSTNlxBRBFURzePCOxE5xsqsPMw1P3Ft9P9UHkzG1MeltIBSXi1SsXNPbCOaSi p4yx0UWivl+jPZmtWlDn =KfXN -----END PGP SIGNATURE----- --Iu2aLqALtEKOqtjTuHAmIx5iTsNSoUxhD--