3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{ public function sayHello(){ return "Hello world!"; } } class Bar{ public static function sayHello(){ return "Hello world!"; } } $Foo = new Foo(); // This works $message = array( 'Bar' => Bar::sayHello(), 'Foo' => $Foo->sayHello() ); var_dump($message);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eloIM
function name:  (null)
number of ops:  14
compiled vars:  !0 = $Foo, !1 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        INIT_STATIC_METHOD_CALL                                  'Bar', 'sayHello'
          4        DO_FCALL                                      0  $5      
          5        INIT_ARRAY                                       ~6      $5, 'Bar'
   20     6        INIT_METHOD_CALL                                         !0, 'sayHello'
          7        DO_FCALL                                      0  $7      
          8        ADD_ARRAY_ELEMENT                                ~6      $7, 'Foo'
   18     9        ASSIGN                                                   !1, ~6
   23    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Foo:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eloIM
function name:  sayHello
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Hello+world%21'
    6     1*     > RETURN                                                   null

End of function sayhello

End of class Foo.

Class Bar:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eloIM
function name:  sayHello
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'Hello+world%21'
   12     1*     > RETURN                                                   null

End of function sayhello

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.22 ms | 1395 KiB | 15 Q