3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentence = "One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen."; for ($i = 1; $i <= 15; $i++) { if (preg_match('/^((\s*\S+){' . $i . '}(\s*\S+)*?(?<=\.))(?=(\s*\S+).*?(?<=\.)\s*\S+)/', $sentence, $match)) { echo "Summary {$i}: {$match[1]}\n"; } else { echo "Full text {$i}: {$sentence}\n"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
Branch analysis from position: 3
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
Branch analysis from position: 3
filename:       /in/uciuU
function name:  (null)
number of ops:  29
compiled vars:  !0 = $sentence, !1 = $i, !2 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'One+two+three.+Four+five+six.+Seven+eight+nine.+Ten+eleven+twelve.+Thirteen+fourteen+fifteen.'
    4     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->26
    5     3    >   INIT_FCALL                                               'preg_match'
          4        CONCAT                                           ~5      '%2F%5E%28%28%5Cs%2A%5CS%2B%29%7B', !1
          5        CONCAT                                           ~6      ~5, '%7D%28%5Cs%2A%5CS%2B%29%2A%3F%28%3F%3C%3D%5C.%29%29%28%3F%3D%28%5Cs%2A%5CS%2B%29.%2A%3F%28%3F%3C%3D%5C.%29%5Cs%2A%5CS%2B%29%2F'
          6        SEND_VAL                                                 ~6
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !2
          9        DO_ICALL                                         $7      
         10      > JMPZ                                                     $7, ->19
    6    11    >   ROPE_INIT                                     5  ~10     'Summary+'
         12        ROPE_ADD                                      1  ~10     ~10, !1
         13        ROPE_ADD                                      2  ~10     ~10, '%3A+'
         14        FETCH_DIM_R                                      ~8      !2, 1
         15        ROPE_ADD                                      3  ~10     ~10, ~8
         16        ROPE_END                                      4  ~9      ~10, '%0A'
         17        ECHO                                                     ~9
         18      > JMP                                                      ->25
    8    19    >   ROPE_INIT                                     5  ~14     'Full+text+'
         20        ROPE_ADD                                      1  ~14     ~14, !1
         21        ROPE_ADD                                      2  ~14     ~14, '%3A+'
         22        ROPE_ADD                                      3  ~14     ~14, !0
         23        ROPE_END                                      4  ~13     ~14, '%0A'
         24        ECHO                                                     ~13
    4    25    >   PRE_INC                                                  !1
         26    >   IS_SMALLER_OR_EQUAL                                      !1, 15
         27      > JMPNZ                                                    ~18, ->3
   10    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.5 ms | 1388 KiB | 15 Q