Re: [RFC DISCUSSION] typeof
| From: | Fleshgrinder | Date: | Sun, 05 Jun 2016 07:24:28 +0000 |
| Subject: | Re: [RFC DISCUSSION] typeof | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93796@lists.php.net to get a copy of this message | ||
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.
>
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 the
> same thing but name null and float differently.
>
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.
>
I doubt that anybody relies on gettype to determine such things. They
use is_null($x) and $x == null or $x === null. Anyone who relies 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.
>
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.
>
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.)
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc