Hey Derick,

> On 2 Feb 2015, at 16:35, Derick Rethans <der...@php.net> wrote:
> 
> On Mon, 2 Feb 2015, Dmitry Stogov wrote:
> 
>> As I already told, in my opinion, version 0.1 was the perfect solution that
>> fit into PHP semantic very well.
>> 
>> declare(strict_types=1); - is really weird solution.
>> It changes type hinting behavior per file scope, so, just to try strict
>> type hinting in a big project, people will have to change every single PHP
>> file.
> 
> THis is why I believe it makes more sense to have this switch on the 
> callee side, instead of on the calling side.

That does have its advantages. But it also has some quite severe problems.

For starters, if you set that flag on the callee side, you just broke 
everything that uses that function and passes the “wrong” type. That’s a 
migration headache.

It also means that you don’t have any choice over strictness as the user of an 
API: some APIs are strict, others weak. That means three lines of code might 
use three different approaches argument strictness. I don’t like that terribly 
much.

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





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to