Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35019 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36931 invoked by uid 1010); 30 Jan 2008 12:57:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36915 invoked from network); 30 Jan 2008 12:57:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2008 12:57:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=scottmac@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=scottmac@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 72.232.140.210 as permitted sender) X-PHP-List-Original-Sender: scottmac@php.net X-Host-Fingerprint: 72.232.140.210 midden.org.uk Received: from [72.232.140.210] ([72.232.140.210:57007] helo=lovelace.midden.org.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/29-47977-F1470A74 for ; Wed, 30 Jan 2008 07:57:04 -0500 Received: from office.vbulletin.com ([217.155.246.60] helo=[10.0.0.116]) by lovelace.midden.org.uk with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JKCUt-0000Uo-3Y; Wed, 30 Jan 2008 12:56:59 +0000 Message-ID: <47A07413.3080309@php.net> Date: Wed, 30 Jan 2008 12:56:51 +0000 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Etienne Kneuss CC: php-dev References: <47A05612.4020505@php.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] BC break with callbacks in 5.3 From: scottmac@php.net (Scott MacVicar) Hi, If you could rename IS_CALLABLE_CHECK_NO_ACCESS too that would be great, at first glance I expected it to check access on the callback. In reality its to skip the access check, so might be worth checking from a clarity point of view. IS_CALLABLE_SKIP_ACCESS_CHECK or IS_CALLABLE_ACCESS_CHECK_SKIP. Scott Etienne Kneuss wrote: > Hi, > > I planned to do some various callbacks related cleanups on 5_3. > If that's ok with you, I'll come with a patch within the following > days that should fix various issues, including your patch if still > necessary. > > Regards > > On Jan 30, 2008 11:48 AM, Scott MacVicar wrote: >> Hi all, >> >> Static callbacks behave differently between 5.2 and 5.3, I recently >> noticed this when trying to install PEAR, it printed a warning each time >> call_user_func and call_user_func_array was used. >> >> After some tracking down it seems like the callback option for >> zend_parse_parameters was backported from 6 but the strict check was >> left as is. >> >> > class MyClass { function test($var) { echo "$var\n"; } } >> MyClass::Test('regular'); >> call_user_func(array('MyClass', 'test'), 'callback'); >> ?> >> >> The prints E_STRICT errors in PHP 5.2 but in 5.3 you get a single >> E_STRICT error followed by a warning for call_user_func. >> >> You can resolve this by adding the static keyword to the method >> declaration but regardless it's inconsistent as stands. I think the >> strict flag needs to be removed for 5.3. >> >> Patch is attached to resolve the issue. >> >> Scott >> >> Index: ZendEngine2/zend_API.c >> =================================================================== >> RCS file: /repository/ZendEngine2/zend_API.c,v >> retrieving revision 1.296.2.27.2.34.2.17 >> diff -u -r1.296.2.27.2.34.2.17 zend_API.c >> --- ZendEngine2/zend_API.c 24 Jan 2008 10:49:26 -0000 1.296.2.27.2.34.2.17 >> +++ ZendEngine2/zend_API.c 30 Jan 2008 10:37:45 -0000 >> @@ -2568,7 +2568,7 @@ >> zend_function *func; >> zval **obj; >> >> - if (!zend_is_callable_ex(callable, IS_CALLABLE_STRICT, callable_name, NULL, &ce, &func, &obj TSRMLS_CC)) { >> + if (!zend_is_callable_ex(callable, 0, callable_name, NULL, &ce, &func, &obj TSRMLS_CC)) { >> return FAILURE; >> } >> >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > >