Hi, 2015-03-18 20:42 GMT+01:00 Lazare Inepologlou <linep...@gmail.com>: > However, it seems that the second form is possible to fail, and that > depends on the mode (strict or not) of the library that contains the > function a. It does not depend on the mode that I have chosen to work with. > The two closures will not work in the same way and that's a kind of a WTF > moment.
If the library documents that it is passing an int or an intable value in non-strict to the callback and it does not do so it has a bug. If the library does not declare a type and you hint an int and it passes something else, you created a bug. However, to work in a real code base some discipline and clean documentation from the library author is required. But I agree that this is currently fragile. Having a way to hint a callables signature may not solve the issue , but make it easier to catch and shift most, if not all, responsibility to the library author. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php