3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ranges = explode(',', '221-231,232-242,243-253,254-264,265-275,276-286,287-297,298-308,309-319,320-330,331-341,342-352'); $rackIds = array(); foreach($ranges as $range) { $racks = explode('-', $range); $start = $racks[0]; $end = $racks[1]; for ($i = $start; $i <= $end; $i++) { $rackIds[] = $i; } } print_r($rackIds);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 19
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 19
Branch analysis from position: 24
Branch analysis from position: 19
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/mkgNT
function name:  (null)
number of ops:  30
compiled vars:  !0 = $ranges, !1 = $rackIds, !2 = $range, !3 = $racks, !4 = $start, !5 = $end, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '%2C'
          2        SEND_VAL                                                 '221-231%2C232-242%2C243-253%2C254-264%2C265-275%2C276-286%2C287-297%2C298-308%2C309-319%2C320-330%2C331-341%2C342-352'
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !0, $7
    3     5        ASSIGN                                                   !1, <array>
    5     6      > FE_RESET_R                                       $10     !0, ->25
          7    > > FE_FETCH_R                                               $10, !2, ->25
    6     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '-'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !3, $11
    8    13        FETCH_DIM_R                                      ~13     !3, 0
         14        ASSIGN                                                   !4, ~13
    9    15        FETCH_DIM_R                                      ~15     !3, 1
         16        ASSIGN                                                   !5, ~15
   11    17        ASSIGN                                                   !6, !4
         18      > JMP                                                      ->22
   12    19    >   ASSIGN_DIM                                               !1
         20        OP_DATA                                                  !6
   11    21        PRE_INC                                                  !6
         22    >   IS_SMALLER_OR_EQUAL                                      !6, !5
         23      > JMPNZ                                                    ~20, ->19
    5    24    > > JMP                                                      ->7
         25    >   FE_FREE                                                  $10
   16    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.16 ms | 1388 KiB | 17 Q