php/php-src — pull request #107 by ofavre (2012-06-14 10:29:22+00:00)
Title: Permit Type-Hinting from extensions

All extensions use `ZEND_ARG_INFO`, `ZEND_ARG_OBJ_INFO` or `ZEND_ARG_ARRAY_INFO`, but none use `ZEND_ARG_TYPE_INFO`, because of a bug.
The advantage of using the latter over the primer is that it permits giving a type _hint_ to PHP.
The only impact of a type hint should be visible in the Reflection extension, as it merely is a _hint_.

However Zend emits a bug systematically if the type info is given: `PHP Fatal error: Unknown typehint in file.php on line 1`.
The first commit fixes this bug, enabling widespread use of `ZEND_ARG_TYPE_INFO`.

Currently only `ReflectionParameter::__toString()` permits getting back this information inside a PHP script, forcing ugly string analysis to get it back.
The second commit makes the type hint information accessible through the `ReflectionParameter::getTypeHint()` method, which returns, like `gettype()`, the string representation of the given type hint, or NULL if none is provided (yet).