3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Cl { public function scalar(): void { static $counter = 0; } public function obj(): void { static $counter = new class() {}; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hsMgb
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                       1

Class class@anonymous: [no user functions]
Class Cl:
Function scalar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hsMgb
function name:  scalar
number of ops:  2
compiled vars:  !0 = $counter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                                  !0
    7     1      > RETURN                                                       null

End of function scalar

Function obj:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hsMgb
function name:  obj
number of ops:  6
compiled vars:  !0 = $counter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   BIND_INIT_STATIC_OR_JMP                                      !0
          1        DECLARE_ANON_CLASS                                   <unknown> 
          2        NEW                                                  $2      $1
          3        DO_FCALL                                          0          
          4        BIND_STATIC                                                  !0, $2
   12     5      > RETURN                                                       null

End of function obj

End of class Cl.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.78 ms | 474 KiB | 7 Q