Edit report at https://bugs.php.net/bug.php?id=63107&edit=1
ID: 63107 Updated by: larue...@php.net Reported by: sanity at wh00s dot net Summary: call_user_func[_array] with property holding Closure causes crash -Status: Open +Status: Not a bug Type: Bug Package: Reproducible crash Operating System: Windows 7 PHP Version: 5.3.17 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php it's not a closure specific issue it's a stack overflow segfault due to recursive function call. Previous Comments: ------------------------------------------------------------------------ [2012-09-18 07:30:11] sanity at wh00s dot net Description: ------------ Having an anonymous function as a class property and executing it with call_user_func() or call_user_func_array() causes PHP to crash. Test script: --------------- class Foo { function __call($name, $args) { call_user_func(array($this, $name), $args); } } $bar = new Foo; $bar->prop = function(){}; $bar->prop(); /* circumventing it can be achieved with the following: */ $method = $this->{$name}; call_user_func($method, $args); Expected result: ---------------- Successful exeuction of anonymous function (or at least an error message). Actual result: -------------- PHP crashes. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63107&edit=1