3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'hello world good morning'; $result = []; $i = 0; while (preg_match_all("/(?=\b(\w+(?: \w+){{$i}})\b)/", $string, $m)) { array_unshift($result, $m[1]); ++$i; } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 4
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 4
Branch analysis from position: 19
Branch analysis from position: 4
filename:       /in/miKoG
function name:  (null)
number of ops:  23
compiled vars:  !0 = $string, !1 = $result, !2 = $i, !3 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'hello+world+good+morning'
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 0
    6     3      > JMP                                                      ->10
    7     4    >   INIT_FCALL                                               'array_unshift'
          5        SEND_REF                                                 !1
          6        FETCH_DIM_R                                      ~7      !3, 1
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                                 
    8     9        PRE_INC                                                  !2
    6    10    >   INIT_FCALL                                               'preg_match_all'
         11        ROPE_INIT                                     3  ~11     '%2F%28%3F%3D%5Cb%28%5Cw%2B%28%3F%3A+%5Cw%2B%29%7B'
         12        ROPE_ADD                                      1  ~11     ~11, !2
         13        ROPE_END                                      2  ~10     ~11, '%7D%29%5Cb%29%2F'
         14        SEND_VAL                                                 ~10
         15        SEND_VAR                                                 !0
         16        SEND_REF                                                 !3
         17        DO_ICALL                                         $13     
         18      > JMPNZ                                                    $13, ->4
   10    19    >   INIT_FCALL                                               'var_export'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.32 ms | 1002 KiB | 16 Q