summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2013-08-22 12:10:15 +0200
committerIgor Wiedler <igor@wiedler.ch>2013-08-22 15:51:26 +0200
commit31d77053a14f59748c12afce82d31fb880dbc962 (patch)
tree9ccaff21b0695422a634c383e3ebf83c4430c127
parent6b385ebc85ea8f01db726fbf06b82b4587fee332 (diff)
downloadphp-git-31d77053a14f59748c12afce82d31fb880dbc962.tar.gz
More test cases for conflicting aliases
-rw-r--r--Zend/tests/use_const/conflicting_use_alias.phpt18
-rw-r--r--Zend/tests/use_function/conflicting_use_const_alias.phpt23
2 files changed, 41 insertions, 0 deletions
diff --git a/Zend/tests/use_const/conflicting_use_alias.phpt b/Zend/tests/use_const/conflicting_use_alias.phpt
new file mode 100644
index 0000000000..91cd020968
--- /dev/null
+++ b/Zend/tests/use_const/conflicting_use_alias.phpt
@@ -0,0 +1,18 @@
+--TEST--
+use and use function with the same alias
+--FILE--
+<?php
+
+namespace {
+ const foo = 'foo';
+}
+
+namespace x {
+ use foo as bar;
+ use const foo as bar;
+ var_dump(bar);
+}
+
+?>
+--EXPECT--
+string(3) "foo"
diff --git a/Zend/tests/use_function/conflicting_use_const_alias.phpt b/Zend/tests/use_function/conflicting_use_const_alias.phpt
new file mode 100644
index 0000000000..b8472a5821
--- /dev/null
+++ b/Zend/tests/use_function/conflicting_use_const_alias.phpt
@@ -0,0 +1,23 @@
+--TEST--
+use and use function with the same alias
+--FILE--
+<?php
+
+namespace {
+ const foo = 'foo.const';
+ function foo() {
+ return 'foo.function';
+ }
+}
+
+namespace x {
+ use const foo as bar;
+ use function foo as bar;
+ var_dump(bar);
+ var_dump(bar());
+}
+
+?>
+--EXPECT--
+string(9) "foo.const"
+string(12) "foo.function"