summaryrefslogtreecommitdiff
path: root/Zend/tests/use_function
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2013-07-23 21:08:49 +0200
committerIgor Wiedler <igor@wiedler.ch>2013-08-22 15:51:26 +0200
commite1125a6a894a8b005aaea6b8ce2e0ea6bf39e483 (patch)
tree90f61ea2df5bc65239676bda4211bb9498c3776b /Zend/tests/use_function
parent5dd41627bed892e76492ae3945e3b0d9cac21019 (diff)
downloadphp-git-e1125a6a894a8b005aaea6b8ce2e0ea6bf39e483.tar.gz
Correctly distinguish between functions and constants
So far 'use function' applied to both constants and functions. This patch correctly separates the two.
Diffstat (limited to 'Zend/tests/use_function')
-rw-r--r--Zend/tests/use_function/ignore_constants.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/Zend/tests/use_function/ignore_constants.phpt b/Zend/tests/use_function/ignore_constants.phpt
new file mode 100644
index 0000000000..c50ff7357a
--- /dev/null
+++ b/Zend/tests/use_function/ignore_constants.phpt
@@ -0,0 +1,23 @@
+--TEST--
+use function should ignore namespaced constants
+--FILE--
+<?php
+
+namespace foo {
+ const bar = 42;
+}
+
+namespace {
+ const bar = 43;
+}
+
+namespace {
+ use function foo\bar;
+ var_dump(bar);
+ echo "Done\n";
+}
+
+?>
+--EXPECT--
+int(43)
+Done