Fixed bug #34678 (__call(), is_callable() and static methods)

This commit is contained in:
Dmitry Stogov 2005-10-03 09:12:19 +00:00
parent 728acc3785
commit 594fd87ca7
3 changed files with 27 additions and 1 deletions

1
NEWS
View File

@ -40,6 +40,7 @@ PHP NEWS
- Fixed "make test" to work for phpized extensions. (Hartmut, Jani)
- Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems.
(Andrey)
- Fixed bug #34678 (__call(), is_callable() and static methods). (Dmitry)
- Fixed bug #34645 (ctype corrupts memory when validating large numbers). (Ilia)
- Fixed bug #34643 (wsdl default value has no effect). (Dmitry)
- Fixed bug #34617 (zend_deactivate: objects_store used after

25
Zend/tests/bug34678.phpt Executable file
View File

@ -0,0 +1,25 @@
--TEST--
Bug #34678 (__call(), is_callable() and static methods)
--FILE--
<?php
class A {
public function __call($m, $a) {
echo "__call\n";
}
}
class B extends A {
public static function foo() {
echo "foo\n";
}
}
if (is_callable(array('B', 'foo'))) {
call_user_func(array('B', 'foo'));
}
if (is_callable(array('A', 'foo'))) {
call_user_func(array('A', 'foo'));
}
?>
--EXPECT--
foo

View File

@ -2068,7 +2068,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char **
}
}
/* check for __call too */
if (retval == 0 && ce->__call != 0) {
if (retval == 0 && *zobj_ptr_ptr && ce->__call != 0) {
retval = 1;
}
efree(lcname);