3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "1;2;3;4;5;6;7;8;9"; $n = 2; echo implode(';', array_merge(array_slice($arr = explode(';', $input), -$n), array_slice($arr, $n, -$n), array_slice($arr, 0, $n)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2vJc
function name:  (null)
number of ops:  34
compiled vars:  !0 = $input, !1 = $n, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1%3B2%3B3%3B4%3B5%3B6%3B7%3B8%3B9'
    4     1        ASSIGN                                                   !1, 2
    5     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%3B'
          4        INIT_FCALL                                               'array_merge'
          5        INIT_FCALL                                               'array_slice'
          6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%3B'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        ASSIGN                                           ~6      !2, $5
         11        SEND_VAL                                                 ~6
         12        MUL                                              ~7      !1, -1
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        SEND_VAR                                                 $8
         16        INIT_FCALL                                               'array_slice'
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !1
         19        MUL                                              ~9      !1, -1
         20        SEND_VAL                                                 ~9
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        INIT_FCALL                                               'array_slice'
         24        SEND_VAR                                                 !2
         25        SEND_VAL                                                 0
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $11     
         28        SEND_VAR                                                 $11
         29        DO_ICALL                                         $12     
         30        SEND_VAR                                                 $12
         31        DO_ICALL                                         $13     
         32        ECHO                                                     $13
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.32 ms | 1396 KiB | 21 Q