3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (range(0, 4) as $len) { echo "$len: ------------\n"; $list = array_fill(0, $len, 42); $first = array_slice($list, 0, 3); $rest = array_slice($list, 3); var_dup($first, $rest); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 31
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 31
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/IpnG6
function name:  (null)
number of ops:  33
compiled vars:  !0 = $len, !1 = $list, !2 = $first, !3 = $rest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 4
          3        DO_ICALL                                         $4      
          4      > FE_RESET_R                                       $5      $4, ->31
          5    > > FE_FETCH_R                                               $5, !0, ->31
    3     6    >   NOP                                                      
          7        FAST_CONCAT                                      ~6      !0, '%3A+------------%0A'
          8        ECHO                                                     ~6
    4     9        INIT_FCALL                                               'array_fill'
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 42
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !1, $7
    5    15        INIT_FCALL                                               'array_slice'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 3
         19        DO_ICALL                                         $9      
         20        ASSIGN                                                   !2, $9
    6    21        INIT_FCALL                                               'array_slice'
         22        SEND_VAR                                                 !1
         23        SEND_VAL                                                 3
         24        DO_ICALL                                         $11     
         25        ASSIGN                                                   !3, $11
    7    26        INIT_FCALL_BY_NAME                                       'var_dup'
         27        SEND_VAR_EX                                              !2
         28        SEND_VAR_EX                                              !3
         29        DO_FCALL                                      0          
    2    30      > JMP                                                      ->5
         31    >   FE_FREE                                                  $5
    8    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.46 ms | 1396 KiB | 19 Q