3v4l.org

run code in 300+ PHP versions simultaneously
<?php $workTimeRange = [ ['time'=>600], ['time'=>900], ['time'=>3600], ['time'=>4000], ]; $arrWorkRange = []; for ($i = 0; $i < ceil(count($workTimeRange) / 2); $i+=2) { echo $i.PHP_EOL; array_push($arrWorkRange, [ 'start_time' => $workTimeRange[$i]['time'], 'end_time' => $workTimeRange[$i+1]['time'], ]); print_r($arrWorkRange); } print_R($arrWorkRange); for($i=0;$i<count($workTimeRange);$i+=2){ echo $i.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 4
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 33
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 33
Branch analysis from position: 39
Branch analysis from position: 33
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 4
Branch analysis from position: 28
Branch analysis from position: 4
filename:       /in/NRv0u
function name:  (null)
number of ops:  40
compiled vars:  !0 = $workTimeRange, !1 = $arrWorkRange, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   12     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->21
   13     4    >   CONCAT                                           ~6      !2, '%0A'
          5        ECHO                                                     ~6
   14     6        INIT_FCALL                                               'array_push'
          7        SEND_REF                                                 !1
   15     8        FETCH_DIM_R                                      ~7      !0, !2
          9        FETCH_DIM_R                                      ~8      ~7, 'time'
         10        INIT_ARRAY                                       ~9      ~8, 'start_time'
   16    11        ADD                                              ~10     !2, 1
         12        FETCH_DIM_R                                      ~11     !0, ~10
         13        FETCH_DIM_R                                      ~12     ~11, 'time'
         14        ADD_ARRAY_ELEMENT                                ~9      ~12, 'end_time'
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                                 
   18    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
   12    20        ASSIGN_OP                                     1          !2, 2
         21    >   INIT_FCALL                                               'ceil'
         22        COUNT                                            ~16     !0
         23        DIV                                              ~17     ~16, 2
         24        SEND_VAL                                                 ~17
         25        DO_ICALL                                         $18     
         26        IS_SMALLER                                               !2, $18
         27      > JMPNZ                                                    ~19, ->4
   20    28    >   INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
   22    31        ASSIGN                                                   !2, 0
         32      > JMP                                                      ->36
   23    33    >   CONCAT                                           ~22     !2, '%0A'
         34        ECHO                                                     ~22
   22    35        ASSIGN_OP                                     1          !2, 2
         36    >   COUNT                                            ~24     !0
         37        IS_SMALLER                                               !2, ~24
         38      > JMPNZ                                                    ~25, ->33
   24    39    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.82 ms | 1400 KiB | 19 Q