summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2012-11-20 12:54:40 +0400
committerDmitry Stogov <dmitry@zend.com>2012-11-20 12:54:40 +0400
commit111aa9fd2ecbfcc1d8048dca96932b3b954614bf (patch)
treec1b96475b82a2aaf8d8f7e4058c84959464aef0f
parent75746d60b6e6a45512842e222429c127be58b733 (diff)
parent396c1e990a0e513cf2e8510e9b6f82ab425c9e3a (diff)
downloadphp-git-111aa9fd2ecbfcc1d8048dca96932b3b954614bf.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fixed bug #63468 (wrong called method as callback with inheritance) Conflicts: NEWS
-rw-r--r--NEWS2
-rw-r--r--Zend/tests/bug63468.phpt30
-rw-r--r--Zend/zend_API.c2
3 files changed, 33 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 3672fe038c..d02a8c96af 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP NEWS
?? ??? 2012, PHP 5.4.9
- Core:
+ . Fixed bug #63468 (wrong called method as callback with inheritance).
+ (Laruence)
. Fixed bug #63305 (zend_mm_heap corrupted with traits). (Dmitry, Laruence)
. Fixed bug #63369 ((un)serialize() leaves dangling pointers, causes crashes).
(Tony, Andrew Sitnikov)
diff --git a/Zend/tests/bug63468.phpt b/Zend/tests/bug63468.phpt
new file mode 100644
index 0000000000..00b5a41c90
--- /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 45abcf61e8..c3d62c2729 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2732,7 +2732,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;