3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { static $bar = 1; $bar++; echo $bar; unset($bar); /* $bar = " | "; echo $bar; static $bar = 5; $bar++; echo $bar; //*/ } function test2($unset = false) { static $bar = 1; $bar++; echo $bar; unset($bar); $bar = " | "; echo $bar; static $bar = 5; $bar++; echo $bar; } test1(); test1(); test1(); test1(); echo "\n"; test2(); test2(); test2(); test2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RT1Is
function name:  (null)
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   INIT_FCALL                                               'test1'
          1        DO_FCALL                                      0          
   41     2        INIT_FCALL                                               'test1'
          3        DO_FCALL                                      0          
   42     4        INIT_FCALL                                               'test1'
          5        DO_FCALL                                      0          
   43     6        INIT_FCALL                                               'test1'
          7        DO_FCALL                                      0          
   44     8        ECHO                                                     '%0A'
   45     9        INIT_FCALL                                               'test2'
         10        DO_FCALL                                      0          
   46    11        INIT_FCALL                                               'test2'
         12        DO_FCALL                                      0          
   47    13        INIT_FCALL                                               'test2'
         14        DO_FCALL                                      0          
   48    15        INIT_FCALL                                               'test2'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RT1Is
function name:  test1
number of ops:  6
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
    5     2        PRE_INC                                                  !1
    6     3        ECHO                                                     !1
    9     4        UNSET_CV                                                 !1
   20     5      > RETURN                                                   null

End of function test1

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RT1Is
function name:  test2
number of ops:  11
compiled vars:  !0 = $unset, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV_INIT                                        !0      <false>
   23     1        BIND_STATIC                                              !1
   24     2        PRE_INC                                                  !1
   25     3        ECHO                                                     !1
   28     4        UNSET_CV                                                 !1
   31     5        ASSIGN                                                   !1, '+%7C+'
   32     6        ECHO                                                     !1
   34     7        BIND_STATIC                                              !1
   35     8        PRE_INC                                                  !1
   36     9        ECHO                                                     !1
   37    10      > RETURN                                                   null

End of function test2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.23 ms | 1396 KiB | 17 Q