3v4l.org

run code in 500+ PHP versions simultaneously
<?php $temp = array("one","two","three","four","five"); $arrayResult = array(); for($i = 0; $i< count($temp); $i++){ for($j = 0; $j< count($temp) - $i; $j++){ $tempArr = $temp; $newArray[$i+1] = '*'; array_splice($tempArr,$j, $i+1,$newArray); $arrayResult [] = $tempArr; } } print_r($arrayResult);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 4
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 6
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 4
Branch analysis from position: 28
Branch analysis from position: 4
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 6
Branch analysis from position: 24
Branch analysis from position: 6
filename:       /in/9KRYJ
function name:  (null)
number of ops:  32
compiled vars:  !0 = $temp, !1 = $arrayResult, !2 = $i, !3 = $j, !4 = $tempArr, !5 = $newArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    3     1        ASSIGN                                                       !1, <array>
    4     2        ASSIGN                                                       !2, 0
          3      > JMP                                                          ->25
    5     4    >   ASSIGN                                                       !3, 0
          5      > JMP                                                          ->20
    6     6    >   ASSIGN                                                       !4, !0
    7     7        ADD                                                  ~11     !2, 1
          8        ASSIGN_DIM                                                   !5, ~11
          9        OP_DATA                                                      '%2A'
    8    10        INIT_FCALL                                                   'array_splice'
         11        SEND_REF                                                     !4
         12        SEND_VAR                                                     !3
         13        ADD                                                  ~13     !2, 1
         14        SEND_VAL                                                     ~13
         15        SEND_VAR                                                     !5
         16        DO_ICALL                                                     
    9    17        ASSIGN_DIM                                                   !1
         18        OP_DATA                                                      !4
    5    19        PRE_INC                                                      !3
         20    >   COUNT                                                ~17     !0
         21        SUB                                                  ~18     ~17, !2
         22        IS_SMALLER                                                   !3, ~18
         23      > JMPNZ                                                        ~19, ->6
    4    24    >   PRE_INC                                                      !2
         25    >   COUNT                                                ~21     !0
         26        IS_SMALLER                                                   !2, ~21
         27      > JMPNZ                                                        ~22, ->4
   13    28    >   INIT_FCALL                                                   'print_r'
         29        SEND_VAR                                                     !1
         30        DO_ICALL                                                     
         31      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.96 ms | 2341 KiB | 15 Q