Your examples only show class methods with visibility qualifyiers, and
looking at the changes to zend_language_parser.y
it seems as if would only be available for methods. Wouldn't return
hints be available for plain functions?

In functional programming, it is common to return nullable types:
returns an instance of class Foo or null, an array or false, etc.

This is supported in normal arguments with the "= null" hint, and I
think there should be something equivalent for return types.
Does the proposed implementation allow null everywhere? (there's an
example of returning null from a return hint of array)
That seems wrong to me. Unless there's a way to make it strict (eg.
array! for only arrays).


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

Reply via email to