3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { static $bar = 0; $bar++; echo $bar; if ($unset) { // removes var from scope but value remains unset($bar); $bar = 10; } } test1(); test1(); test1(true); test1();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xd6Bp
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'test1'
          1        DO_FCALL                                      0          
   20     2        INIT_FCALL                                               'test1'
          3        DO_FCALL                                      0          
   21     4        INIT_FCALL                                               'test1'
          5        SEND_VAL                                                 <true>
          6        DO_FCALL                                      0          
   22     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 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/Xd6Bp
function name:  test1
number of ops:  8
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        PRE_INC                                                  !1
    8     3        ECHO                                                     !1
   10     4      > JMPZ                                                     !0, ->7
   12     5    >   UNSET_CV                                                 !1
   14     6        ASSIGN                                                   !1, 10
   16     7    > > RETURN                                                   null

End of function test1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.41 ms | 1399 KiB | 15 Q