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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.05 ms | 1396 KiB | 17 Q