facebook/hhvm — pull request #1600 by thekid (2014-01-19 23:05:40+00:00)
Title: Reflection compliance

This pull request aims at achieving a greater level of compliance with the original PHP reflection API. It uses [these behaviour tests](https://github.com/thekid/behave/tree/hhvm/src/test/php/ext/reflection) to verify the Reflection classes' functionality.

These bugs are fixed:

* #1598 - ReflectionParameter::canBePassedByValue()
* #1596 - ReflectionClass::isCloneable()
* #1358 - Zend incompatibility: ReflectionParameter's function name should accept closure, not only string
* #1572 - Reflection classes should have a __clone method

Furthermore, these issues are addressed:

* Support for `parent` and `self` as parameter type hints
* Missing ReflectionFunction::inNamespace(), isDeprecated(), getExtension[Name]()
* ReflectionFunction::getStaticVariables() returns string representations of statics, not the actual values
* Fix BadMethodCallException for ReflectionClass::getExtensionName()
* ReflectionClass::isAbstract() does not return true for traits
* ReflectionParameter::__toString should include indicator whether passed by reference
* ReflectionFunction does not have a public name member

There are still differences to the PHP API which I could not address here (e.g. all extension related reflection - HipHop's concept seems to work differently than PHP's, I still haven't quite understood how this could be made to work) and cases in which PHP raises errors, where HipHop throws exceptions for self-consistency.