Re: [RFC] Scalar Type Hints v0.2

From: Date: Wed, 04 Feb 2015 17:24:09 +0000
Subject: Re: [RFC] Scalar Type Hints v0.2
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Dmitry and Sebastian,

> On 4 Feb 2015, at 05:49, Sebastian Bergmann <[email protected]> wrote:
> 
> Am 04.02.2015 um 06:44 schrieb Dmitry Stogov:
>> What do you think about using only lowercase type names for scalar type
>> hints? In this case we won't have to introduce any limitations.
> 
> This would be inconsistent with the rest of PHP being case-insensitive
> and only lead to confusion.

This is how I feel. Array and Callable work, yet if Integer and String didn’t it’d be
inconsistent.

Also, we’d *still* have a BC issue, because who says that people with String classes didn’t use
a lowercase type hint?

I think the BC cost, while unfortunate, is unavoidable. Luckily, code can be changed in such a way
that it’ll keep working fine on PHP 5 and only break on PHP 7, by using class_alias().

Thanks.
--
Andrea Faulds
http://ajf.me/






Thread (148 messages)

« previous php.internals (#81826) next »