jphp
jphp copied to clipboard
Cannot concatenate late static binding class name
Code:
<?php
class a
{
public static function test() {
var_dump(''.static::class);
}
}
a::test();
Result:
[daniil@daniil-arch jav]$ jppm start
-> linux
-> app:run
-> install
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
$php_module_m6f748827be7a4d14956c5053c7c41744_class0.test$0(Lphp/runtime/env/Environment;[Lphp/runtime/Memory;)Lphp/runtime/Memory; @7: invokestatic
Reason:
Type 'java/lang/String' (current frame, stack[2]) is not assignable to 'php/runtime/Memory'
Current Frame:
bci: @7
flags: { }
locals: { 'php/runtime/env/Environment', '[Lphp/runtime/Memory;' }
stack: { 'php/runtime/env/Environment', 'java/lang/String', 'java/lang/String' }
Bytecode:
0x0000000: 2a12 282a b600 2eb8 0034 b800 3a01 b800
0x0000010: 4057 b200 46b0
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getConstructor(Class.java:1825)
at php.runtime.reflection.ClassEntity.setNativeClazz(ClassEntity.java:855)
at php.runtime.loader.RuntimeClassLoader.loadClass(RuntimeClassLoader.java:55)
at php.runtime.loader.RuntimeClassLoader.loadModule(RuntimeClassLoader.java:113)
at php.runtime.env.CompileScope.loadModule(CompileScope.java:599)
at php.runtime.env.CompileScope.loadModule(CompileScope.java:603)
at php.runtime.env.Environment.importModule(Environment.java:1253)
at php.runtime.env.ConcurrentEnvironment.importModule(ConcurrentEnvironment.java:175)
at php.runtime.env.ModuleManager.fetchTemporaryModule(ModuleManager.java:71)
at php.runtime.env.ModuleManager.fetchModule(ModuleManager.java:41)
at php.runtime.env.ModuleManager.fetchModule(ModuleManager.java:27)
at php.runtime.launcher.Launcher.loadFrom(Launcher.java:121)
at php.runtime.launcher.Launcher.run(Launcher.java:308)
at php.runtime.launcher.Launcher.run(Launcher.java:247)
at php.runtime.launcher.Launcher.run(Launcher.java:243)
at php.runtime.launcher.Launcher.main(Launcher.java:425)