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 <[EMAIL PROTECTED]> 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. > > <?php > 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php