- Re-enabled phar for big-endian systems after fixing problems. (Greg)
+- Fixed bug #47593 (interface_exists() returns false when using absolute
+ namespace path). (Kalle, Felipe)
+- Fixed bug #47572 (Undefined constant causes segmentation fault). (Felipe)
- Fixed bug #47549 (get_defined_constants() return array with broken
array categories). (Ilia)
- Fixed Bug #47443 (metaphone('scratch') returns wrong result). (Felipe)
--- /dev/null
+--TEST--
+Bug #47593 (interface_exists() returns false when using absolute namespace path)
+--FILE--
+<?php
+
+namespace test;
+const TEST = 11;
+
+class foo {
+ public function xyz() {
+ }
+}
+
+interface baz {
+}
+
+function bar() {
+}
+
+
+var_dump(interface_exists('\test\baz'));
+var_dump(function_exists('\test\bar'));
+var_dump(constant('\test\TEST'));
+var_dump(defined('\test\TEST'));
+var_dump(defined('TEST'));
+
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+int(11)
+bool(true)
+bool(false)
}
if (!autoload) {
+ char *name;
+ int len;
+
lc_name = do_alloca(iface_name_len + 1, use_heap);
zend_str_tolower_copy(lc_name, iface_name, iface_name_len);
- found = zend_hash_find(EG(class_table), lc_name, iface_name_len+1, (void **) &ce);
+ /* Ignore leading "\" */
+ name = lc_name;
+ len = iface_name_len;
+ if (lc_name[0] == '\\') {
+ name = &lc_name[1];
+ len--;
+ }
+
+ found = zend_hash_find(EG(class_table), name, len+1, (void **) &ce);
free_alloca(lc_name, use_heap);
RETURN_BOOL(found == SUCCESS && (*ce)->ce_flags & ZEND_ACC_INTERFACE);
}
}
lcname = zend_str_tolower_dup(name, name_len);
+
+ /* Ignore leading "\" */
+ name = lcname;
+ if (lcname[0] == '\\') {
+ name = &lcname[1];
+ name_len--;
+ }
- retval = (zend_hash_find(EG(function_table), lcname, name_len+1, (void **)&func) == SUCCESS);
+ retval = (zend_hash_find(EG(function_table), name, name_len+1, (void **)&func) == SUCCESS);
efree(lcname);