Re: Re: [RFC] Reserving More Types in PHP 7
| From: | Benjamin Eberlei | Date: | Mon, 27 Apr 2015 08:15:19 +0000 |
| Subject: | Re: Re: [RFC] Reserving More Types in PHP 7 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85962@lists.php.net to get a copy of this message | ||
On Mon, Apr 27, 2015 at 6:44 AM, Stanislav Malyshev <smalyshev@gmail.com>
wrote:
> Hi!
>
> > Well, it looks to me like all the discussion is around preventing
> > class and namespace names like “string”, “float”, etc. Granted, PHP
> > class names are case-insensitive, but how hard would it be to reserve
> > these in a case-sensitive way?
>
> With current engine - I'd say it is hard. We can't really say "class
> names are case insentitive unless it's "string" or "float" or
> "boolean"
> in which case they are case sensitive". Imagine how code implementing
> such logic would look like, not to talk about the inconsistencies...
>
> > Lithium, CakePHP, and Drupal all have String classes. These aren’t
>
> Unfortunately, with scalar types we don't have much choice. I don't see
> how scalar types and classes named "string" can coexist.
>
> > I get that PHP 7 is the big opportunity to break backward
> > compatibility, but yeesh, really? It’s like we’re not even trying
> > anymore.
>
> There was a lot of discussion about this topic. Right now, unless
> there's a proposal to fix it that works, I don't see what can be done
> about it.
>
It should be possible to write something with PHP Parser detecting all the
occurances of "String/string" class usage to at least give a worklog of
entries that need to be changed, or maybe generate a patch file that can be
applied to the code base after review.
> --
> Stas Malyshev
> smalyshev@gmail.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>