Re: Re: Improving PHP's type system

From: Date: Thu, 14 Apr 2016 17:54:23 +0000
Subject: Re: Re: Improving PHP's type system
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-92309@lists.php.net to get a copy of this message
On 4/14/2016 2:47 PM, Lin Yo-An wrote: > But weak type conversion and union type are not, it introduces more complex > rules of how variables should be converted into another values, and there > will be more implementation defined behavior. People will have to always > have a cheatsheet or something to check whether if they write the correct > code. > > And I believe, if we can remove the support of weak type conversion, PHP > could be a "consistent", "simple" language and it can help people write > confident code. > 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. -- Richard "Fleshgrinder" Fussenegger

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#92309) next »