3v4l.org

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

Function f1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 4
Branch analysis from position: 9
Branch analysis from position: 4
filename:       /in/6rGlg
function name:  f1
number of ops:  11
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, 1
    5     2        ASSIGN                                                   !2, !0
          3      > JMP                                                      ->7
    6     4    >   MUL                                              ~5      !1, !2
          5        ASSIGN                                                   !1, ~5
    5     6        PRE_DEC                                                  !2
          7    >   IS_SMALLER                                               0, !2
          8      > JMPNZ                                                    ~8, ->4
    9     9    > > RETURN                                                   !1
   10    10*     > RETURN                                                   null

End of function f1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.61 ms | 1397 KiB | 14 Q