Hi Stas, > On 4 Jan 2015, at 23:58, Stanislav Malyshev <smalys...@gmail.com> wrote: > >> I think it's perfectly acceptable that PHP makes a built-in type a >> reserved word. I would certainly not change it to PHPInt to "avoid any >> obvious clashes". > > As I already pointed out, if we make it reserved word we'll have BC > problem. We already had this experience when goto became reserved word - > it resulted in a lot of breakage. This would be bigger, since we adding > more reserved words and we know they are used in a lot of class names > (and, possibly, method names too).
It is a BC problem, yes. However, it can be worked around in userland in a way where unchanged code will continue to work on PHP 5, and changed code will work on both PHP 5 and PHP 7. I think the BC break is worth it, though unfortunate. I also wonder why we hadn’t reserved these names before, it seems rather silly that you were ever able to make a class called “integer” or “array”. By the way, we might want to pre-reserve `resource` as well. This RFC intentionally does not add a type hint for it, but we may wish to do so in future. It might also help with the migration to classes, too, as this would stop userland developers creating classes called “Resource” in the global namespace that would cause a future conflict. Thoughts? -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php