Hi,

On Mon, Jun 6, 2011 at 22:35, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> Hi!
>
>> See attached patch+phpt; Any objections to include it in 5.4?
>
> Yes, same objections as for other static typing.

Those objections do not apply here IMO.

IIRC, the main objections were that if we introduce strict hints for
scalar values, then we start rejecting stuff that would "just work"
via implicit conversions before. i.e. "2" vs 2.

In this case, if you don't provide a valid callback to a function
expecting a valid callback, there is no way it will "just work".

Just like with other type hints, if you write function foo(A $b) and
pass B which is not a subtype of A, there is no way foo() will "just
work", as there is no way it will be able to interpret the value, an
object of type B, as an object of type A.

+1 from me, this seems very useful.

>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Etienne Kneuss
http://www.colder.ch

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

Reply via email to