Hi, 

I’m coming back to this thread after some discussions about related matters 
off-list. I’m firmly convinced this is a good idea, now:

* It would be very useful to extend the callable type hint to support typed 
parameters and return types. If we were to do so, its validation rules should 
follow inheritance’s. It would be really unfortunate if you couldn’t pass an 
untyped callback to a callable with typed parameters.
* With the Scalar Type Hints RFCs, and other future RFCs, more type hints may 
be added to the language. It’d be a shame if existing interfaces couldn’t have 
type hints added to them.
* Contravariance is widely accepted as being sound for parameter types. 
* We already have covariance for return type existence. So why not 
contravariance for parameter type existence?

I hope we can have this added.

--
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