com php-src: Fixed bug #63468 (wrong called method as callback with inheritance): NEWS Zend/tests/bug63468.phpt Zend/zend_API.c
| From: | Dmitry Stogov | Date: | Tue, 20 Nov 2012 08:51:55 +0000 |
| Subject: | com php-src: Fixed bug #63468 (wrong called method as callback with inheritance): NEWS Zend/tests/bug63468.phpt Zend/zend_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70562@lists.php.net to get a copy of this message | ||
Commit: 396c1e990a0e513cf2e8510e9b6f82ab425c9e3a
Author: Dmitry Stogov <dmitry@zend.com> Tue, 20 Nov 2012 12:51:55 +0400
Parents: d412152f31f145bf07b243465cdffa84ceba70be
Branches: PHP-5.3 PHP-5.4 PHP-5..5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=396c1e990a0e513cf2e8510e9b6f82ab425c9e3a
Log:
Fixed bug #63468 (wrong called method as callback with inheritance)
Bugs:
https://bugs.php.net/63468
Changed paths:
M NEWS
A Zend/tests/bug63468.phpt
M Zend/zend_API.c
Diff:
diff --git a/NEWS b/NEWS
index 4f89d07..717a382 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PHP NEWS
- Zend Engine:
. Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes
from value). (Pierrick)
+ . Fixed bug #63468 (wrong called method as callback with inheritance).
+ (Laruence)
- Core:
. Fixed bug #63451 (config.guess file does not have AIX 7 defined,
shared objects are not created). (kemcline at au1 dot ibm dot com)
diff --git a/Zend/tests/bug63468.phpt b/Zend/tests/bug63468.phpt
new file mode 100644
index 0000000..00b5a41
--- /dev/null
+++ b/Zend/tests/bug63468.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #63468 (wrong called method as callback with inheritance)
+--FILE--
+<?php
+class Foo
+{
+ public function run()
+ {
+ return call_user_func(array('Bar', 'getValue'));
+ }
+
+ private static function getValue()
+ {
+ return 'Foo';
+ }
+}
+
+class Bar extends Foo
+{
+ public static function getValue()
+ {
+ return 'Bar';
+ }
+}
+
+$x = new Bar;
+var_dump($x->run());
+--EXPECT--
+string(3) "Bar"
+
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index d529775..c1b501b 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2520,7 +2520,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable,
zend_fca
} else if (zend_hash_find(ftable, lmname, mlen+1, (void**)&fcc->function_handler) ==
SUCCESS) {
retval = 1;
if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) &&
- EG(scope) &&
+ !strict_class && EG(scope) &&
instanceof_function(fcc->function_handler->common.scope, EG(scope) TSRMLS_CC)) {
zend_function *priv_fbc;