cvs: ZendEngine2(PHP_5_3) / zend_compile.c /tests bug44653.phpt
[email protected] ("Dmitry Stogov")
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsdmitry1207731346@cvsserver> |
dmitry Wed Apr 9 08:55:46 2008 UTC
Added files: (Branch: PHP_5_3)
/ZendEngine2/tests bug44653.phpt
Modified files:
/ZendEngine2 zend_compile.c
Log:
Bug #44653 (Invalid namespace name resolution)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.57&r2=1.647.2.27.2.41.2.58&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.57 ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.58
--- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.57 Fri Mar 28 14:34:59 2008
+++ ZendEngine2/zend_compile.c Wed Apr 9 08:55:45 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.57 2008/03/28 14:34:59 felipe Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.58 2008/04/09 08:55:45 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -1597,16 +1597,9 @@
zend_class_entry **pce;
if (check_ns_name) {
- char *ns_lcname = zend_str_tolower_dup(Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
-
- if (Z_STRLEN_P(CG(current_namespace)) == Z_STRLEN(class_name->u.constant) &&
- memcmp(lcname, ns_lcname, Z_STRLEN(class_name->u.constant)) == 0) {
- /* The given name is equal to name of current namespace.
- PHP will need to perform additional cheks at run-time to
- determine if we assume namespace or class name. */
- *fetch_type |= ZEND_FETCH_CLASS_RT_NS_NAME;
- }
- efree(ns_lcname);
+ /* PHP will need to perform additional cheks at run-time to
+ determine if we assume namespace or class name. */
+ *fetch_type |= ZEND_FETCH_CLASS_RT_NS_NAME;
}
if ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) ||
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug44653.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug44653.phpt
+++ ZendEngine2/tests/bug44653.phpt
--TEST--
Bug #44653 (Invalid namespace name resolution)
--FILE--
<?php
namespace A;
const XX=1;
function fooBar() { echo __FUNCTION__ . PHP_EOL; }
namespace B;
class A {
static function fooBar() { echo "bag1\n"; }
}
class B {
static function fooBar() { echo "bag2\n"; }
}
function fooBar() { echo __FUNCTION__ . PHP_EOL; }
var_dump(A::XX);
A::fooBar();
fooBar();
B::fooBar();
?>
--EXPECT--
int(1)
A::fooBar
B::fooBar
B::fooBar