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 concatenate late static binding class name #406

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

Cannot concatenate late static binding class name #406

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

Comments

@danog
Copy link

danog commented Mar 9, 2020

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)

@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
Labels
Development

No branches or pull requests

2 participants