3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { static function bar() { echo 'baz'; } } class Ex { public $a; public function __construct() { $this->a = Foo; } public function doIt() { ${$this->a}::bar(); } } $a = new Ex(); $a->doIt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/upRRl
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Ex'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'doIt'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function bar

End of class Foo.

Class Ex:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/upRRl
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_CONSTANT                                   ~1      'Foo'
          1        ASSIGN_OBJ                                               'a'
          2        OP_DATA                                                  ~1
   14     3      > RETURN                                                   null

End of function __construct

Function doit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/upRRl
function name:  doIt
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1        FETCH_R                      local               ~1      ~0
          2        FETCH_CLASS                                   0  $2      ~1
          3        INIT_STATIC_METHOD_CALL                                  $2, 'bar'
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function doit

End of class Ex.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.35 ms | 1395 KiB | 13 Q