Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35061 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82627 invoked by uid 1010); 31 Jan 2008 19:46:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 82611 invoked from network); 31 Jan 2008 19:46:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2008 19:46:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=cellog@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cellog@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 38.99.98.18 as permitted sender) X-PHP-List-Original-Sender: cellog@php.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:56863] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/73-07682-99522A74 for ; Thu, 31 Jan 2008 14:46:35 -0500 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 38EBBC0EA07; Thu, 31 Jan 2008 12:46:31 -0700 (MST) Received: from [129.93.148.98] (pcp077491pcs.unl.edu [129.93.148.98]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id A9F4BC0EA03; Thu, 31 Jan 2008 12:46:30 -0700 (MST) Message-ID: <47A22593.1010709@php.net> Date: Thu, 31 Jan 2008 13:46:27 -0600 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Marcus Boerger CC: Scott MacVicar , php-dev References: <47A05612.4020505@php.net> <1462818236.20080130160605@marcus-boerger.de> In-Reply-To: <1462818236.20080130160605@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] BC break with callbacks in 5.3 From: cellog@php.net (Greg Beaver) Marcus Boerger wrote: > Hello Scott, > > actually it was a bug. We, sorry I, did not spot this in earlier versions. > Now saying you rely on a bug in PHP 5 to be able to execute PHP 4 code > simply does not work. Hi Marcus, How is forcing users to replace call_user_func(array('Classname', 'func')) with eval('Classname::func') a good policy? When this example code: functions differently from this code: And in a minor version increment, this in fact introduces a bug, and doesn't fix one. I think the fix may be to simply add retval=0 in zend_is_callable_check_func() here: if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) { retval = 0; } else { if (EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), *ce_ptr TSRMLS_CC)) { *zobj_ptr_ptr = &EG(This); zend_error(E_STRICT, "Non-static method %s::%s() cannot be called statically, assuming $this from compatible context %s", (*ce_ptr)->name, fptr->common.function_name, Z_OBJCE_P(EG(This))->name); } else { zend_error(E_STRICT, "Non-static method %s::%s() cannot be called statically", (*ce_ptr)->name, fptr->common.function_name); } } basically what is happening is that E_STRICT makes the callback invalid, which is not technically true - the callback is valid, just not strictly correct. I can make a patch next week, if someone doesn't beat me to it. We need a retval=0 in the inner else clause Greg