3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = 'in the middle 9850112686331(14-15) for Rocco A & Stephanie'; $arr = explode(' ', $subject); $candidates = []; for ($i = 0; $i < count($arr); $i++) { for ($j = $i; $j < count($arr); $j++) { $candidates[] = implode(' ', array_slice($arr, $i, $j - $i + 1)) . PHP_EOL; } } sort($candidates); print_r($candidates);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 9
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 11
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 9
Branch analysis from position: 33
Branch analysis from position: 9
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 11
Branch analysis from position: 29
Branch analysis from position: 11
filename:       /in/XNLbX
function name:  (null)
number of ops:  40
compiled vars:  !0 = $subject, !1 = $arr, !2 = $candidates, !3 = $i, !4 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'in+the+middle+9850112686331%2814-15%29+for+Rocco+A+%26+Stephanie'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    6     6        ASSIGN                                                   !2, <array>
    7     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->30
    8     9    >   ASSIGN                                                   !4, !3
         10      > JMP                                                      ->26
    9    11    >   INIT_FCALL                                               'implode'
         12        SEND_VAL                                                 '+'
         13        INIT_FCALL                                               'array_slice'
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !3
         16        SUB                                              ~12     !4, !3
         17        ADD                                              ~13     ~12, 1
         18        SEND_VAL                                                 ~13
         19        DO_ICALL                                         $14     
         20        SEND_VAR                                                 $14
         21        DO_ICALL                                         $15     
         22        CONCAT                                           ~16     $15, '%0A'
         23        ASSIGN_DIM                                               !2
         24        OP_DATA                                                  ~16
    8    25        PRE_INC                                                  !4
         26    >   COUNT                                            ~18     !1
         27        IS_SMALLER                                               !4, ~18
         28      > JMPNZ                                                    ~19, ->11
    7    29    >   PRE_INC                                                  !3
         30    >   COUNT                                            ~21     !1
         31        IS_SMALLER                                               !3, ~21
         32      > JMPNZ                                                    ~22, ->9
   13    33    >   INIT_FCALL                                               'sort'
         34        SEND_REF                                                 !2
         35        DO_ICALL                                                 
   15    36        INIT_FCALL                                               'print_r'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.97 ms | 1400 KiB | 23 Q