Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92309 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62558 invoked from network); 14 Apr 2016 17:54:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2016 17:54:44 -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.83 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.83 mx102.easyname.com Received: from [77.244.243.83] ([77.244.243.83:57882] helo=mx202.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/61-53665-269DF075 for ; Thu, 14 Apr 2016 13:54:43 -0400 Received: from cable-81-173-133-226.netcologne.de ([81.173.133.226] 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 1aqlTT-0004q2-Fn; Thu, 14 Apr 2016 17:54:39 +0000 Reply-To: internals@lists.php.net References: <570E99AC.3090804@fleshgrinder.com> <570EA5EB.8090501@fleshgrinder.com> <570EAB0D.6080706@gmail.com> <570EB67E.8010908@garfieldtech.com> <5B147E88-CC0A-4CBC-A49D-C7FE3BF557C0@zend.com> <6F.C3.12455.94C5F075@pb1.pair.com> <20160414094440.GF19347@phcomp.co.uk> To: Lin Yo-An , "internals@lists.php.net" Message-ID: <570FD94F.90703@fleshgrinder.com> Date: Thu, 14 Apr 2016 19:54:23 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iHVa2456LpO1R6KJ6TfCS3F5hckIg4wrM" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] Re: Improving PHP's type system From: php@fleshgrinder.com (Fleshgrinder) --iHVa2456LpO1R6KJ6TfCS3F5hckIg4wrM Content-Type: multipart/mixed; boundary="LhUNRR8tihKhAJV7dJgu6bKxb1DfoWtGb" From: Fleshgrinder Reply-To: internals@lists.php.net To: Lin Yo-An , "internals@lists.php.net" Message-ID: <570FD94F.90703@fleshgrinder.com> Subject: Re: [PHP-DEV] Re: Improving PHP's type system References: <570E99AC.3090804@fleshgrinder.com> <570EA5EB.8090501@fleshgrinder.com> <570EAB0D.6080706@gmail.com> <570EB67E.8010908@garfieldtech.com> <5B147E88-CC0A-4CBC-A49D-C7FE3BF557C0@zend.com> <6F.C3.12455.94C5F075@pb1.pair.com> <20160414094440.GF19347@phcomp.co.uk> In-Reply-To: --LhUNRR8tihKhAJV7dJgu6bKxb1DfoWtGb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 4/14/2016 2:47 PM, Lin Yo-An wrote: > But weak type conversion and union type are not, it introduces more com= plex > rules of how variables should be converted into another values, and the= re > will be more implementation defined behavior. People will have to alway= s > have a cheatsheet or something to check whether if they write the corre= ct > code. >=20 > And I believe, if we can remove the support of weak type conversion, PH= P > could be a "consistent", "simple" language and it can help people write= > confident code. >=20 I don't know what is complicated about "string|Stringable" or "Foo|Bar" since it is super self-explanatory. However, I find myself checking the docs (IDE or online) in which order I need to pass arguments to one of the various mixed up functions in the core all the time. PHP is not easy, it has so many quirks that one needs to know of that you could make a PhD only for that. https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ This contains A LOT of that stuff. --=20 Richard "Fleshgrinder" Fussenegger --LhUNRR8tihKhAJV7dJgu6bKxb1DfoWtGb-- --iHVa2456LpO1R6KJ6TfCS3F5hckIg4wrM 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 iQIcBAEBCAAGBQJXD9lTAAoJEOKkKcqFPVVrCx8QAJT/75+DmrjHYYD3vKIFYGYW gwGB4DQ9Tw75lo8qa2TUMr1bw/uoESMmTnEsvVAoHlF7xp8hLIhtCzWAEy1Jy13T 3+WWjaF7MNjb7T5t27y+VpX/3gJPkovLTA8tY6aP7PuuF21tjd+A2eOe5sKui8kb d4X9700I6rJaV8PblcwvUcjldCAMbKL+ZKxEXCJfe0TVCrSnoSh7czMZQwJIjnxj bE8q6TkK8xvcZkJv0TPSKvwqlyFkYAZLlFaZ+bJUlLWZvEb4A5DSJ8oIVeAl7ABK 3SbIsA45aQUQBF06pD2fW3yMT1NgPJCedoXpJ8hmmhFSJHX9UwiOmo8yJrRjSDim 0w4HbjCs2EdfQ6TtYjc4MvAyzQUTe8uhTYc853N4q9DjTTnao0oT1ae6gA7rol+e /BPa1603mJJC9YvYevCt88omUsstDX3ywINIDLLZOxistitZ/V5wXf9foYmi7y0P CkGFpMGtHqhBEKRwHpEI9S9x4JuwOq9MVNnsuK+FO6b1EY6mjkBxsf3bORpedTf2 MDNu8QO6mpj6IuxveE2Kgy8l9Fbtf97rdIT/RocOQ6qzaNSw+QAqmSPki1VP9ycw r6nF4jcXp5TJtDC7pQhPjKR3P7VXzyOW4NPaBrhU9579E2erKd9cPQoHgHLAtLMh ant1cPR9yRNnqtlPrgJF =nTuu -----END PGP SIGNATURE----- --iHVa2456LpO1R6KJ6TfCS3F5hckIg4wrM--