bug39884.phpt 578 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #39884 (ReflectionParameter::getClass() throws exception for type hint self)
  3. --FILE--
  4. <?php
  5. class stubParamTest
  6. {
  7. function paramTest(self $param)
  8. {
  9. // nothing to do
  10. }
  11. }
  12. $test1 = new stubParamTest();
  13. $test2 = new stubParamTest();
  14. $test1->paramTest($test2);
  15. $refParam = new ReflectionParameter(array('stubParamTest', 'paramTest'), 'param');
  16. var_dump($refParam->getClass());
  17. ?>
  18. --EXPECTF--
  19. Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
  20. object(ReflectionClass)#4 (1) {
  21. ["name"]=>
  22. string(13) "stubParamTest"
  23. }