Bug #64987 [Asn->Opn]: unexpected result for call_user_func() in the debug_backtrace()

From: Date: Tue, 24 Oct 2017 08:03:53 +0000
Subject: Bug #64987 [Asn->Opn]: unexpected result for call_user_func() in the debug_backtrace()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212211@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64987&edit=1 ID: 64987 Updated by: kalle@php.net Reported by: tyrael@php.net Summary: unexpected result for call_user_func() in the debug_backtrace() -Status: Assigned +Status: Open Type: Bug Package: Scripting Engine problem Operating System: irrelevant PHP Version: 5.3.26 -Assigned To: laruence +Assigned To: Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2013-06-24 09:17:25] dmitry@php.net In my opinion, the current implementation is the right one. It follows the simple rule: when we call some function from an internal one we don't track file name and line number (just because we don't have PHP source for it). I don't think we need to fix this behaviour. Thanks. Dmitry. ------------------------------------------------------------------------ [2013-06-09 09:02:35] laruence@php.net A patch is added, introduced a new fn_flag ZEND_ACC_CALL_PROXY, applies to call_user_func, call_user_func_array, forward_static_call, reflectionMethod- >invoke etc and this only flag should only affects debug_backtrace handling ... thanks ------------------------------------------------------------------------ [2013-06-09 09:00:08] laruence@php.net The following patch has been added/updated: Patch Name: add_call_proxy_flag.patch Revision: 1370768408 URL: https://bugs.php.net/patch-display.php?bug=64987&patch=add_call_proxy_flag.patch&revision=1370768408 ------------------------------------------------------------------------ [2013-06-07 17:15:45] laruence@php.net hmm, I may find a solution, use tricky ZEND_CALL_VIA_HANDLER fn_flags, for call_user_func, may like: $ git diff diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 9c91404..03f836e 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2983,7 +2983,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(error_log, arginfo_error_log) PHP_FE(error_get_last, arginfo_error_get_last) - PHP_FE(call_user_func, arginfo_call_user_func) + ZEND_FENTRY(call_user_func, ZEND_FN(call_user_func), arginfo_call_user_func, ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_ PUBLIC) PHP_FE(call_user_func_array, arginfo_call_user_func_array) PHP_DEP_FE(call_user_method, arginfo_call_user_method) PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array) ------------------------------------------------------------------------ [2013-06-07 17:08:16] laruence@php.net I understood your point, I just don't know how to fix other related functions once. call_user_func, call_method, reflectionmethod->invoke, reflectionFunction->invoke etc. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=64987 -- Edit this bug report at https://bugs.php.net/bug.php?id=64987&edit=1

« previous php.bugs (#212211) next »