Skip to content

Commit 31d7705

Browse files
committed
More test cases for conflicting aliases
1 parent 6b385eb commit 31d7705

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
use and use function with the same alias
3+
--FILE--
4+
<?php
5+
6+
namespace {
7+
const foo = 'foo';
8+
}
9+
10+
namespace x {
11+
use foo as bar;
12+
use const foo as bar;
13+
var_dump(bar);
14+
}
15+
16+
?>
17+
--EXPECT--
18+
string(3) "foo"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
use and use function with the same alias
3+
--FILE--
4+
<?php
5+
6+
namespace {
7+
const foo = 'foo.const';
8+
function foo() {
9+
return 'foo.function';
10+
}
11+
}
12+
13+
namespace x {
14+
use const foo as bar;
15+
use function foo as bar;
16+
var_dump(bar);
17+
var_dump(bar());
18+
}
19+
20+
?>
21+
--EXPECT--
22+
string(9) "foo.const"
23+
string(12) "foo.function"

0 commit comments

Comments
 (0)