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(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snhhS
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snhhS
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/snhhS
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/snhhS
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:
152.97 ms | 1394 KiB | 13 Q