3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f1($x) { $sum=2; for($i=$x;$i>0;$i--){ $sum+=$i; } return $sum;} $a=f1(6); echo $a; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sEXlA
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'f1'
          1        SEND_VAL                                                 6
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   10     4        ECHO                                                     !0
   11     5      > RETURN                                                   1

Function f1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
Branch analysis from position: 4
filename:       /in/sEXlA
function name:  f1
number of ops:  10
compiled vars:  !0 = $x, !1 = $sum, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 2
    5     2        ASSIGN                                                   !2, !0
          3      > JMP                                                      ->6
    6     4    >   ASSIGN_OP                                     1          !1, !2
    5     5        PRE_DEC                                                  !2
          6    >   IS_SMALLER                                               0, !2
          7      > JMPNZ                                                    ~7, ->4
    8     8    > > RETURN                                                   !1
          9*     > RETURN                                                   null

End of function f1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.06 ms | 1397 KiB | 14 Q