jphp icon indicating copy to clipboard operation
jphp copied to clipboard

Cannot alias namespace with `use`

Open danog opened this issue 5 years ago • 0 comments

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

danog avatar Mar 09 '20 13:03 danog