3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filesize = 15123456; $max_at_a_time = 5 * 1000 * 1000; // try 5 Mb limit $full_chunks = floor($filesize / $max_at_a_time); $remainder = $filesize % $max_at_a_time; for ($i=0; $i < $full_chunks; $i++) { // create new context with range echo ('Range: bytes='.$i*$max_at_a_time.'-'.(($i+1)*$max_at_a_time)-1); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 11
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 11
Branch analysis from position: 22
Branch analysis from position: 11
filename:       /in/F70h6
function name:  (null)
number of ops:  23
compiled vars:  !0 = $filesize, !1 = $max_at_a_time, !2 = $full_chunks, !3 = $remainder, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 15123456
    4     1        ASSIGN                                                   !1, 5000000
    5     2        INIT_FCALL                                               'floor'
          3        DIV                                              ~7      !0, !1
          4        SEND_VAL                                                 ~7
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !2, $8
    6     7        MOD                                              ~10     !0, !1
          8        ASSIGN                                                   !3, ~10
    8     9        ASSIGN                                                   !4, 0
         10      > JMP                                                      ->20
   12    11    >   MUL                                              ~13     !4, !1
         12        CONCAT                                           ~14     'Range%3A+bytes%3D', ~13
         13        CONCAT                                           ~15     ~14, '-'
         14        ADD                                              ~16     !4, 1
         15        MUL                                              ~17     !1, ~16
         16        SUB                                              ~18     ~17, 1
         17        CONCAT                                           ~19     ~15, ~18
         18        ECHO                                                     ~19
    8    19        PRE_INC                                                  !4
         20    >   IS_SMALLER                                               !4, !2
         21      > JMPNZ                                                    ~21, ->11
   14    22    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.03 ms | 1395 KiB | 15 Q