Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75547 invoked from network); 18 Dec 2015 00:50:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2015 00:50:15 -0000 X-Host-Fingerprint: 2.218.134.247 unknown Received: from [2.218.134.247] ([2.218.134.247:13213] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/8B-51216-54853765 for ; Thu, 17 Dec 2015 19:50:14 -0500 Message-ID: <31.8B.51216.54853765@pb1.pair.com> To: internals@lists.php.net References: Date: Fri, 18 Dec 2015 00:50:09 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 2.218.134.247 Subject: Re: call_user_function_ex() affects zval value From: ajf@ajf.me (Andrea Faulds) 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/