3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public function __construct() { echo "constructing\n"; } } function f() { static $v; if ($v === null) $v = new C; } f(); f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4eh1C
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'f'
          1        DO_FCALL                                      0          
   12     2        INIT_FCALL                                               'f'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/4eh1C
function name:  f
number of ops:  7
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_STATIC                                              !0
    9     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->6
          3    >   NEW                                              $2      'C'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   10     6    > > RETURN                                                   null

End of function f

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

End of function __construct

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.81 ms | 1397 KiB | 15 Q