Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot alias namespace with `use` #389

Open
danog opened this issue Mar 9, 2020 · 0 comments
Open

Cannot alias namespace with `use` #389

danog opened this issue Mar 9, 2020 · 0 comments
Labels
bug

Comments

@danog
Copy link

@danog danog commented Mar 9, 2020

Code:

// src/n.php 

namespace a;

use b;

include 'src/included.php';

new b\test();

// src/included.php

namespace b;

class test
{}

Result:

[daniil@daniil-arch jav]$ php src/n.php 
[daniil@daniil-arch jav]$ jppm start
-> linux
-> app:run 
-> install 

Fatal error: Uncaught Error: Class 'a\b\test' not found in res://n.php on line 9, position 1
Stack Trace:
#0 <internal>() called at [res://n.php:1]
#1 {main}
  thrown in res://n.php on line 9
@dim-s dim-s added the bug label Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.