Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21941 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52153 invoked by uid 1010); 19 Feb 2006 13:02:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 52138 invoked from network); 19 Feb 2006 13:02:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2006 13:02:05 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:42326] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6F/A0-45151-C4C68F34 for ; Sun, 19 Feb 2006 08:02:04 -0500 Received: from [192.168.1.3] (dslb-084-063-013-216.pools.arcor-ip.net [84.63.13.216]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id D164F35C1D1 for ; Sun, 19 Feb 2006 13:31:41 +0100 (CET) Date: Sun, 19 Feb 2006 13:31:47 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1113872920.20060219133147@marcus-boerger.de> To: internals@lists.php.net In-Reply-To: <1692386645.20060219115704@marcus-boerger.de> References: <1692386645.20060219115704@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Deprecation of functions From: helly@php.net (Marcus Boerger) Hello internals, i digged a bit deeper regarding the assumption that zend_call_function() is missing the abstract check and it shows that right now we delay error generation. The following back trace shows that actually we have a special opcode that is necessary to do so: #0 zend_error (type=1, format=0x86adbf8 "Cannot call abstract method %v::%v()") at /usr/src/php-cvs/Zend/zend.c:1363 #1 0x084736de in ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER (execute_data=0xbf950114, tsrm_ls=0x878c248) at /usr/src/php-cvs/Zend/zend_vm_execute.h:461 #2 0x0847140c in execute (op_array=0x8946c10, tsrm_ls=0x878c248) at /usr/src/php-cvs/Zend/zend_vm_execute.h:92 #3 0x0843335a in zend_call_function (fci=0xbf950344, fci_cache=0x0, tsrm_ls=0x878c248) at /usr/src/php-cvs/Zend/zend_execute_API.c:981 That said i think moving the abstract test into zend_call_function() just like it is inside the function call helper opcode is the way to go. regards marcus Sunday, February 19, 2006, 11:57:04 AM, you wrote: > Hello internals, > i just made up a tiny patch that allows us to deprecate functions. The > background is that in the past we changed to issue E_STRICT or E_NOTICE > for stuff we are going to change in later versions. This is right now not > easily possible when we change to replace a functions name. The usual way > to add the new name is to rename the function and add an alias with the old > name but for the deprecation message we would need to have the function > implementation twice so that one can issue the message. The patch now > allows us to specify a function flag on the alias. > I checked an early version of the patch with Andi and he didn't like the > introduction of another if(). For the explicit calling handler i see no > problem in adding it since it is just an integer comparision which makes > out less than 0.1% of the zend_call_function() for the function-call > opcode i hid the check behind the abstract check. So there is no new > penalty. And actually i think the abstract check is neccessary for the > the other part also. So the patch found an error and doesn't come with any > additional penalty at all. > Patch is available for both 5.1 and HEAD here: > http://php.net/~helly/php/ext/ze2/ze2-deprecated-20060219-5_1.diff.txt > http://php.net/~helly/php/ext/ze2/ze2-deprecated-20060219-HEAD.diff.txt > Anyone against?