Re: Nullable types and strict type-hinting with default null value
| From: | Levi Morrison | Date: | Thu, 23 Feb 2017 14:38:19 +0000 |
| Subject: | Re: Nullable types and strict type-hinting with default null value | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98347@lists.php.net to get a copy of this message | ||
On Wed, Feb 22, 2017 at 2:18 PM, Michał <aaatoja@o2.pl> wrote:
> a(string $test=null) // incorrect type, should throw error
>
> There is no reason, except of backwards compatibility, to keep this
> behaviour. It's too late to change this in 7.1, maybe even in 7.2. But, what
> is Your opinion? Should it be preserved or fixed?
My opinion is that it is far too early to try to change it in any way.
Maybe in PHP version 8.0 we could add an E_DEPRECATED or E_STRICT but
it's far too early to do anything in the 7.X series.