3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); $datastart = 3; $string = implode(',', array_merge(array_slice($data, $datastart), array_slice($data, 0, $datastart))); echo $string . "\n"; $len = count($data); $string = ''; for ($i = 0; $i < $len; $i++) { $string .= ($i > 0 ? ',' : '') . $data[($i + $datastart) % $len]; } echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 27
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 27
Branch analysis from position: 40
Branch analysis from position: 27
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 27
Branch analysis from position: 40
Branch analysis from position: 27
filename:       /in/T1jnE
function name:  (null)
number of ops:  42
compiled vars:  !0 = $data, !1 = $datastart, !2 = $string, !3 = $len, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 3
    6     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%2C'
          4        INIT_FCALL                                               'array_merge'
          5        INIT_FCALL                                               'array_slice'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        SEND_VAR                                                 $7
         10        INIT_FCALL                                               'array_slice'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !2, $10
    7    20        CONCAT                                           ~12     !2, '%0A'
         21        ECHO                                                     ~12
    9    22        COUNT                                            ~13     !0
         23        ASSIGN                                                   !3, ~13
   10    24        ASSIGN                                                   !2, ''
   11    25        ASSIGN                                                   !4, 0
         26      > JMP                                                      ->38
   12    27    >   IS_SMALLER                                               0, !4
         28      > JMPZ                                                     ~17, ->31
         29    >   QM_ASSIGN                                        ~18     '%2C'
         30      > JMP                                                      ->32
         31    >   QM_ASSIGN                                        ~18     ''
         32    >   ADD                                              ~19     !4, !1
         33        MOD                                              ~20     ~19, !3
         34        FETCH_DIM_R                                      ~21     !0, ~20
         35        CONCAT                                           ~22     ~18, ~21
         36        ASSIGN_OP                                     8          !2, ~22
   11    37        PRE_INC                                                  !4
         38    >   IS_SMALLER                                               !4, !3
         39      > JMPNZ                                                    ~25, ->27
   14    40    >   ECHO                                                     !2
   15    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
284.29 ms | 1017 KiB | 16 Q