3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function hello() { echo "Hello !"; } } class Bar { public $apple = null; public function __construct() { $this->apple = new Foo(); } } $foo = new Bar(); $baz = ($foo->apple)::hello(); $baz::hello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2c1R
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        FETCH_OBJ_R                                      ~5      !0, 'apple'
          4        FETCH_CLASS                                   0  $6      ~5
          5        INIT_STATIC_METHOD_CALL                                  $6, 'hello'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
   21     8        FETCH_CLASS                                   0  $9      !1
          9        INIT_STATIC_METHOD_CALL                                  $9, 'hello'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

End of function hello

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2c1R
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'apple'
          3        OP_DATA                                                  $1
   16     4      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 1394 KiB | 13 Q