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 (sprinf('Range: bytes=%s-%s',$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 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 11
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 11
Branch analysis from position: 24
Branch analysis from position: 11
filename:       /in/OY90R
function name:  (null)
number of ops:  25
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                                                      ->22
   12    11    >   INIT_FCALL_BY_NAME                                       'sprinf'
         12        SEND_VAL_EX                                              'Range%3A+bytes%3D%25s-%25s'
         13        MUL                                              ~13     !4, !1
         14        SEND_VAL_EX                                              ~13
         15        ADD                                              ~14     !4, 1
         16        MUL                                              ~15     !1, ~14
         17        SUB                                              ~16     ~15, 1
         18        SEND_VAL_EX                                              ~16
         19        DO_FCALL                                      0  $17     
         20        ECHO                                                     $17
    8    21        PRE_INC                                                  !4
         22    >   IS_SMALLER                                               !4, !2
         23      > JMPNZ                                                    ~19, ->11
   14    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.9 ms | 1395 KiB | 15 Q