3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Hebrews 11.6 2 Chronicles 10.16 Romans 13.13 2 Kings 5.10 3 John 1.5'; if (preg_match_all('~^(.*?)\h*(\d+)\.(\d+)$~m', $text, $ms, PREG_SET_ORDER, 0)) { foreach ($ms as $m) { $book=$m[1]; $chapter=$m[2]; $verse=$m[3]; echo "Book $book chapter $chapter verse $verse\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 27
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 26
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 26
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 27
filename:       /in/RPOTE
function name:  (null)
number of ops:  28
compiled vars:  !0 = $text, !1 = $ms, !2 = $m, !3 = $book, !4 = $chapter, !5 = $verse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hebrews+11.6%0A2+Chronicles+10.16%0ARomans+13.13%0A2+Kings+5.10%0A3+John+1.5'
    8     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%7E%5E%28.%2A%3F%29%5Ch%2A%28%5Cd%2B%29%5C.%28%5Cd%2B%29%24%7Em'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        SEND_VAL                                                 0
          7        DO_ICALL                                         $7      
          8      > JMPZ                                                     $7, ->27
    9     9    > > FE_RESET_R                                       $8      !1, ->26
         10    > > FE_FETCH_R                                               $8, !2, ->26
   10    11    >   FETCH_DIM_R                                      ~9      !2, 1
         12        ASSIGN                                                   !3, ~9
   11    13        FETCH_DIM_R                                      ~11     !2, 2
         14        ASSIGN                                                   !4, ~11
   12    15        FETCH_DIM_R                                      ~13     !2, 3
         16        ASSIGN                                                   !5, ~13
   13    17        ROPE_INIT                                     7  ~16     'Book+'
         18        ROPE_ADD                                      1  ~16     ~16, !3
         19        ROPE_ADD                                      2  ~16     ~16, '+chapter+'
         20        ROPE_ADD                                      3  ~16     ~16, !4
         21        ROPE_ADD                                      4  ~16     ~16, '+verse+'
         22        ROPE_ADD                                      5  ~16     ~16, !5
         23        ROPE_END                                      6  ~15     ~16, '%0A'
         24        ECHO                                                     ~15
    9    25      > JMP                                                      ->10
         26    >   FE_FREE                                                  $8
   15    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
267.11 ms | 1011 KiB | 14 Q