cvs: ZendEngine2 / zend_API.c /tests bug45744.phpt

From: Date: Thu, 07 Aug 2008 12:03:51 +0000
Subject: cvs: ZendEngine2 / zend_API.c /tests bug45744.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6996@lists.php.net to get a copy of this message
dmitry Thu Aug 7 12:03:51 2008 UTC Added files: /ZendEngine2/tests bug45744.phpt Modified files: /ZendEngine2 zend_API.c Log: Fixed bug #45744 (Case sensitive callback behaviour) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.482&r2=1.483&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.482 ZendEngine2/zend_API.c:1.483 --- ZendEngine2/zend_API.c:1.482 Sat Aug 2 04:40:43 2008 +++ ZendEngine2/zend_API.c Thu Aug 7 12:03:51 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.482 2008/08/02 04:40:43 felipe Exp $ */ +/* $Id: zend_API.c,v 1.483 2008/08/07 12:03:51 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -2899,7 +2899,6 @@ retval = fcc->function_handler ? 1 : 0; call_via_handler = 1; } - efree(lmname.v); if (retval) { if (fcc->calling_scope && !call_via_handler) { @@ -2934,7 +2933,7 @@ } if (retval && (check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) { if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) { - if (!zend_check_private(fcc->function_handler, fcc->object_pp ? Z_OBJCE_PP(fcc->object_pp) : EG(scope), mname, mlen TSRMLS_CC)) { + if (!zend_check_private(fcc->function_handler, fcc->object_pp ? Z_OBJCE_PP(fcc->object_pp) : EG(scope), lmname, lmlen TSRMLS_CC)) { if (error) { if (*error) { efree(*error); @@ -2963,6 +2962,8 @@ if (error) zend_spprintf(error, 0, "function '%R' does not exist", Z_TYPE_P(callable), mname); } } + efree(lmname.v); + if (fcc->object_pp) { fcc->called_scope = Z_OBJCE_PP(fcc->object_pp); } http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug45744.phpt?view=markup&rev=1.1 Index: ZendEngine2/tests/bug45744.phpt +++ ZendEngine2/tests/bug45744.phpt --TEST-- Bug #45744 (Case sensitive callback behaviour) --FILE-- <?php class Foo { public function __construct(array $data) { var_dump(array_map(array($this, 'callback'), $data)); } private function callback($value) { if (!is_array($value)) { return stripslashes($value); } return array_map(array($this, 'callback'), $value); } } class Bar extends Foo { } new Bar(array()); class Foo2 { public function __construct(array $data) { var_dump(array_map(array($this, 'callBack'), $data)); } private function callBack($value) { } } class Bar2 extends Foo2 { } new Bar2(array()); --EXPECT-- array(0) { } array(0) { }

« previous php.zend-engine.cvs (#6996) next »