Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60670 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77257 invoked from network); 23 May 2012 14:50:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2012 14:50:18 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 173.203.6.139 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 173.203.6.139 smtp139.ord.emailsrvr.com Linux 2.6 Received: from [173.203.6.139] ([173.203.6.139:35891] helo=smtp139.ord.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/2E-02922-929FCBF4 for ; Wed, 23 May 2012 10:50:17 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp18.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTP id 8C16B300F2; Wed, 23 May 2012 10:50:14 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp18.relay.ord1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 55DA6300E5; Wed, 23 May 2012 10:50:14 -0400 (EDT) Message-ID: <4FBCF925.2040909@sugarcrm.com> Date: Wed, 23 May 2012 10:50:13 -0400 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Stefan Esser CC: Mailing-List php References: <5262BA67-53D2-4D19-9AD6-B1BFDABAC32E@sektioneins.de> In-Reply-To: <5262BA67-53D2-4D19-9AD6-B1BFDABAC32E@sektioneins.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] zend_execute_internal hook missing from PHP 5 From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Nowadays (since PHP 5.0) the code was moved from > call_user_function_ex to zend_call_function and just looks like > this: > > ((zend_internal_function *) > EX(function_state).function)->handler(fci->param_count, > *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 > TSRMLS_CC); So in zend_vm_def.h we have: if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC); } But in zend_call_function it goes just: ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); So looks like the code is not consistent. You can still catch user functions with zend_execute override but not the internal ones. No idea why the difference exists, I'll look through commits and if I find no reason I guess the should be synchronized. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227