xref: /PHP-7.4/Zend/tests/bug54910.phpt (revision 782352c5)
1--TEST--
2Bug #54910 (Crash when calling call_user_func with unknown function name)
3--FILE--
4<?php
5class 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
13    protected function get() {
14        $class = get_class($this);
15        $call = array($class, 'noSuchMethod');
16
17        if (is_callable($call)) {
18            call_user_func($call);
19        }
20    }
21}
22
23class B extends A {}
24
25$input = new B();
26echo $input->getEmail();
27--EXPECT--
28No such method - 'noSuchMethod'
29