Merge pull request #22 from AlessioGiacobbe/fix/single-segment-imports
fix(resolver): stop corrupting single-segment use const importsmaster
commit
250a384bb8
2 changed files with 33 additions and 5 deletions
@ -0,0 +1,28 @@ |
|||||||
|
--TEST-- |
||||||
|
use const with a single-segment (global) constant name |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
namespace App { |
||||||
|
use const PHP_EOL; |
||||||
|
|
||||||
|
const ANSWER = 42; |
||||||
|
|
||||||
|
function hello(): string |
||||||
|
{ |
||||||
|
return "hello" . PHP_EOL; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
namespace { |
||||||
|
use const App\ANSWER; |
||||||
|
|
||||||
|
function main(): void |
||||||
|
{ |
||||||
|
echo \App\hello(); |
||||||
|
echo ANSWER, "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
hello |
||||||
|
42 |
||||||
Loading…
Reference in new issue