Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35018 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28426 invoked by uid 1010); 30 Jan 2008 12:39:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 28411 invoked from network); 30 Jan 2008 12:39:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2008 12:39:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.82.229 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 66.249.82.229 wx-out-0506.google.com Received: from [66.249.82.229] ([66.249.82.229:18665] helo=wx-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/F7-47977-A1070A74 for ; Wed, 30 Jan 2008 07:39:54 -0500 Received: by wx-out-0506.google.com with SMTP id s14so281979wxc.26 for ; Wed, 30 Jan 2008 04:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=hHc43tzD3yA+P+0/q85ZoT52c41+OMtGZu5tNi+Ama4=; b=pYZJ3wm5YdSopmgM2xkSwoXErIlEzW6+DB5vtoUjM3Cjm0xrPmXRf6gtDaM57htM3r6hXhCkSiSRglgyWYyeRZ88qT6P6PaCc1mZYoG5V2365vOGTMJZK2lxrTWGqK+JuZ2CP/UvPsHthU5sNZTZVaLQgH+lLL1fW44ItutCDbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=LwoDz0Trmgvtsdrju1UqM8x8zvSnEjUKj4f7DndRihBcBffjoX2deZhUXRhXEUWoL6w7EACJXagqTmcxUONQA0UgdKuxytBHcglwZyqBJ6PbLBPRWtntpvx2e/3crjr+xuvYi0LjMJW3ygzvNZcE2OtVo4ncpFD2kUVQsRsvOks= Received: by 10.70.32.2 with SMTP id f2mr435337wxf.63.1201696791806; Wed, 30 Jan 2008 04:39:51 -0800 (PST) Received: by 10.70.30.3 with HTTP; Wed, 30 Jan 2008 04:39:51 -0800 (PST) Message-ID: Date: Wed, 30 Jan 2008 13:39:51 +0100 Sender: ekneuss@gmail.com To: "Scott MacVicar" Cc: php-dev In-Reply-To: <47A05612.4020505@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47A05612.4020505@php.net> X-Google-Sender-Auth: cb201d6a2e59de80 Subject: Re: [PHP-DEV] BC break with callbacks in 5.3 From: colder@php.net ("Etienne Kneuss") 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 > -- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal