3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { static $bar = 0; if ($unset) { unset($bar); // $bar is no longer linked to the static var, but // it will be on the next request! $bar = 10; } else { $bar++; } echo $bar; } test1(); test1(); test1(true); test1();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qjo97
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'test1'
          1        DO_FCALL                                      0          
   21     2        INIT_FCALL                                               'test1'
          3        DO_FCALL                                      0          
   22     4        INIT_FCALL                                               'test1'
          5        SEND_VAL                                                 <true>
          6        DO_FCALL                                      0          
   23     7        INIT_FCALL                                               'test1'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function test1:
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 = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qjo97
function name:  test1
number of ops:  9
compiled vars:  !0 = $unset, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      <false>
    4     1        BIND_STATIC                                              !1
    6     2      > JMPZ                                                     !0, ->6
    7     3    >   UNSET_CV                                                 !1
   11     4        ASSIGN                                                   !1, 10
          5      > JMP                                                      ->7
   13     6    >   PRE_INC                                                  !1
   16     7    >   ECHO                                                     !1
   17     8      > RETURN                                                   null

End of function test1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.31 ms | 1395 KiB | 15 Q