abstract_user_call.phpt 478 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. ZE2 An abstrcat method cannot be called indirectly
  3. --FILE--
  4. <?php
  5. abstract class test_base
  6. {
  7. abstract function func();
  8. }
  9. class test extends test_base
  10. {
  11. function func()
  12. {
  13. echo __METHOD__ . "()\n";
  14. }
  15. }
  16. $o = new test;
  17. $o->func();
  18. call_user_func(array($o, 'test_base::func'));
  19. ?>
  20. ===DONE===
  21. --EXPECTF--
  22. test::func()
  23. Warning: call_user_func() expects parameter 1 to be a valid callback, cannot call abstract method test_base::func() in %s on line %d
  24. ===DONE===