diff options
author | Dmitry Stogov <dmitry@php.net> | 2011-05-31 09:20:51 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2011-05-31 09:20:51 +0000 |
commit | d9ba7820d47e224dc516803363542dd32d81a47e (patch) | |
tree | b053ec6e553d8a2d0a8a3f7cd064a598e17ad487 /Zend/tests/bug54910.phpt | |
parent | 4bc1fb265b7816a5ff0a44098ed9f2397296666b (diff) | |
download | php-git-d9ba7820d47e224dc516803363542dd32d81a47e.tar.gz |
Fixed bug #54910 (Crash when calling call_user_func with unknown function name)
Diffstat (limited to 'Zend/tests/bug54910.phpt')
-rw-r--r-- | Zend/tests/bug54910.phpt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Zend/tests/bug54910.phpt b/Zend/tests/bug54910.phpt new file mode 100644 index 0000000000..8808cd0609 --- /dev/null +++ b/Zend/tests/bug54910.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #54910 (Crash when calling call_user_func with unknown function name) +--FILE-- +<?php +class A { + public function __call($method, $args) { + if (stripos($method, 'get') === 0) { + return $this->get(); + } + die("No such method - '$method'\n"); + } + + protected function get() { + $class = get_class($this); + $call = array($class, 'noSuchMethod'); + + if (is_callable($call)) { + call_user_func($call); + } + } +} + +class B extends A {} + +$input = new B(); +echo $input->getEmail(); +--EXPECT-- +No such method - 'noSuchMethod' |