bug52854.phpt 592 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #52854: ReflectionClass::newInstanceArgs does not work for classes without constructors
  3. --FILE--
  4. <?php
  5. class Test {
  6. }
  7. $c = new ReflectionClass('Test');
  8. var_dump(new Test);
  9. var_dump(new Test());
  10. var_dump($c->newInstance());
  11. var_dump($c->newInstanceArgs(array()));
  12. try {
  13. var_dump($c->newInstanceArgs(array(1)));
  14. } catch(ReflectionException $e) {
  15. echo $e->getMessage()."\n";
  16. }
  17. ?>
  18. --EXPECTF--
  19. object(Test)#%d (0) {
  20. }
  21. object(Test)#%d (0) {
  22. }
  23. object(Test)#%d (0) {
  24. }
  25. object(Test)#%d (0) {
  26. }
  27. Class Test does not have a constructor, so you cannot pass any constructor arguments