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; // this initialization value is hoisted to the top of the function! static $bar = 5; $bar++; echo $bar; echo " "; static $bar = 77; } static $bar = 33; test1(); test1(); test1(); test1();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DMkaC
function name:  (null)
number of ops:  10
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   BIND_STATIC                                              !0
   26     1        INIT_FCALL                                               'test1'
          2        DO_FCALL                                      0          
   27     3        INIT_FCALL                                               'test1'
          4        DO_FCALL                                      0          
   28     5        INIT_FCALL                                               'test1'
          6        DO_FCALL                                      0          
   29     7        INIT_FCALL                                               'test1'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DMkaC
function name:  test1
number of ops:  13
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
   11     5        ASSIGN                                                   !1, '%7C'
   12     6        ECHO                                                     !1
   15     7        BIND_STATIC                                              !1
   16     8        PRE_INC                                                  !1
   17     9        ECHO                                                     !1
   19    10        ECHO                                                     '+'
   21    11        BIND_STATIC                                              !1
   22    12      > RETURN                                                   null

End of function test1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.77 ms | 940 KiB | 16 Q