cvs: ZendEngine2 / zend_reflection_api.c /tests bug29268.phpt
| From: | Dmitry Stogov | Date: | Fri, 21 Oct 2005 08:03:40 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c /tests bug29268.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4273@lists.php.net to get a copy of this message | ||
dmitry Fri Oct 21 04:03:40 2005 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
/ZendEngine2/tests bug29268.phpt
Log:
Fixed bug #29268 (__autoload() not called with Reflection->getClass())
http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.187&r2=1.188&ty=u
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.187 ZendEngine2/zend_reflection_api.c:1.188
--- ZendEngine2/zend_reflection_api.c:1.187 Thu Oct 20 12:46:44 2005
+++ ZendEngine2/zend_reflection_api.c Fri Oct 21 04:03:39 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.187 2005/10/20 16:46:44 tony2001 Exp $ */
+/* $Id: zend_reflection_api.c,v 1.188 2005/10/21 08:03:39 dmitry Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.h"
@@ -1857,16 +1857,12 @@
RETURN_NULL();
} else {
zend_class_entry **pce;
- unsigned int lcname_len;
- char *lcname = zend_u_str_case_fold(UG(unicode)?IS_UNICODE:IS_STRING,
param->arg_info->class_name, param->arg_info->class_name_len, 0, &lcname_len);
- if (zend_u_hash_find(EG(class_table), UG(unicode)?IS_UNICODE:IS_STRING, lcname, lcname_len + 1,
(void **) &pce) == FAILURE) {
- efree(lcname);
+ if (zend_u_lookup_class_ex(UG(unicode)?IS_UNICODE:IS_STRING, param->arg_info->class_name,
param->arg_info->class_name_len, 1, &pce TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC,
"Class %v does not exist", param->arg_info->class_name);
return;
}
- efree(lcname);
zend_reflection_class_factory(*pce, return_value TSRMLS_CC);
}
}
http://cvs.php.net/diff.php/ZendEngine2/tests/bug29268.phpt?r1=1.1&r2=1.2&ty=u
Index: ZendEngine2/tests/bug29268.phpt
diff -u /dev/null ZendEngine2/tests/bug29268.phpt:1.2
--- /dev/null Fri Oct 21 04:03:39 2005
+++ ZendEngine2/tests/bug29268.phpt Fri Oct 21 04:03:39 2005
@@ -0,0 +1,26 @@
+--TEST--
+Bug #29268 (__autoload() not called with reflectionProperty->getClass())
+--FILE--
+<?php
+function __autoload($classname) {
+ echo "__autoload($classname)\n";
+ eval("class $classname {}");
+}
+
+class B{
+ public function doit(A $a){
+ }
+}
+
+$ref = new reflectionMethod('B','doit');
+$parameters = $ref->getParameters();
+foreach($parameters as $parameter){
+ $class = $parameter->getClass();
+ echo $class->name."\n";
+}
+echo "ok\n";
+?>
+--EXPECT--
+__autoload(A)
+A
+ok