Edit report at http://bugs.php.net/bug.php?id=54910&edit=1
ID: 54910 Updated by: fel...@php.net Reported by: aigors at inbox dot lv Summary: Crash when calling call_user_func with unknown function name -Status: Open +Status: Assigned Type: Bug Package: Reproducible crash Operating System: Ubuntu 11.04 PHP Version: 5.3.6 -Assigned To: +Assigned To: dmitry Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2011-05-23 16:18:09] aigors at inbox dot lv Description: ------------ Firstly the function is_callable(array('B', 'noSuchMethod')) returns true even such static method does not exist. This could be caused by class A having magic method __call (which shouldn't accept static methods though). Still because of this the code fails with segmentation fault. Test script: --------------- class A { public function __call($method, $args) { if (stripos($method, 'get') === 0) { return $this->get(); } throw new BadMethodCallException("No such method"); } 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(); Expected result: ---------------- Script should end with no output. Actual result: -------------- Segmentation fault. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54910&edit=1