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'); $rackNames = array(); foreach ($ranges as $range) { $racks = explode('-', $range); $start = $racks[0]; $end = $racks[1]; for ($i = $start; $i <= $end; $i++) { $rackNames[] = (string) $i; } } echo implode(',', $rackNames);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 26
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
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 = 25, Position 2 = 19
Branch analysis from position: 25
Branch analysis from position: 19
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/kOrRs
function name:  (null)
number of ops:  33
compiled vars:  !0 = $ranges, !1 = $rackNames, !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, ->26
          7    > > FE_FETCH_R                                               $10, !2, ->26
    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                                                      ->23
   12    19    >   CAST                                          6  ~19     !6
         20        ASSIGN_DIM                                               !1
         21        OP_DATA                                                  ~19
   11    22        PRE_INC                                                  !6
         23    >   IS_SMALLER_OR_EQUAL                                      !6, !5
         24      > JMPNZ                                                    ~21, ->19
    5    25    > > JMP                                                      ->7
         26    >   FE_FREE                                                  $10
   16    27        INIT_FCALL                                               'implode'
         28        SEND_VAL                                                 '%2C'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $22     
         31        ECHO                                                     $22
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.28 ms | 1396 KiB | 17 Q