Re: call_user_function_ex() affects zval value
| From: | Andrea Faulds | Date: | Fri, 18 Dec 2015 00:50:09 +0000 |
| Subject: | Re: call_user_function_ex() affects zval value | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89837@lists.php.net to get a copy of this message | ||
Hi Adam,
Adam Baratz wrote:
I'm working on PHP7 compatibility for an extension (which I didn't write). I discovered an issue with a call like this: call_user_function_ex(EG(function_table), NULL, zval, &retval, 5, params, 0, NULL); When zval refers to a [object, string] array, its value is different after this call. I haven't seen this issue when zval is a string. I realize the context probably matters here, but I'm having trouble narrowing down what could be doing this. Any suggestions on how to debug this?The function which handles going from a "callable" zval to an actual zend_function pointer is zend_is_callable_ex in Zend/zend_API.c, and I imagine that's where the problem lies. Perhaps it's a reference-counting/copy-on-write issue? Hope this helps! -- Andrea Faulds http://ajf.me/