3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 1; function print_conditional() { static $x; if($x++ == 1) echo "many"; echo "good"; echo "things"; return $x; } print_conditional(); $x++; print_conditional();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TZEnl
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
   11     1        INIT_FCALL                                               'print_conditional'
          2        DO_FCALL                                      0          
   12     3        PRE_INC                                                  !0
   13     4        INIT_FCALL                                               'print_conditional'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function print_conditional:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/TZEnl
function name:  print_conditional
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1        POST_INC                                         ~1      !0
          2        IS_EQUAL                                                 ~1, 1
          3      > JMPZ                                                     ~2, ->5
    6     4    >   ECHO                                                     'many'
    7     5    >   ECHO                                                     'good'
    8     6        ECHO                                                     'things'
    9     7      > RETURN                                                   !0
   10     8*     > RETURN                                                   null

End of function print_conditional

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.07 ms | 1401 KiB | 15 Q