bug54910.phpt 606 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #54910 (Crash when calling call_user_func with unknown function name)
  3. --FILE--
  4. <?php
  5. class A {
  6. public function __call($method, $args) {
  7. if (stripos($method, 'get') === 0) {
  8. return $this->get();
  9. }
  10. die("No such method - '$method'\n");
  11. }
  12. protected function get() {
  13. $class = get_class($this);
  14. $call = array($class, 'noSuchMethod');
  15. if (is_callable($call)) {
  16. call_user_func($call);
  17. }
  18. }
  19. }
  20. class B extends A {}
  21. $input = new B();
  22. echo $input->getEmail();
  23. ?>
  24. --EXPECT--
  25. No such method - 'noSuchMethod'