3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '1. Who was the first president of the United States of America? ANSWER: George Washington'; $regex = '/^(\d+)\.\s+(.+)$^ANSWER:\s+(.+)$/m'; preg_match_all( $regex, $input, $matches); var_dump( $matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAS28
function name:  (null)
number of ops:  11
compiled vars:  !0 = $input, !1 = $regex, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '1.+Who+was+the+first+president+of+the+United+States+of+America%3F%0AANSWER%3A+George+Washington'
    5     1        ASSIGN                                                   !1, '%2F%5E%28%5Cd%2B%29%5C.%5Cs%2B%28.%2B%29%24%5EANSWER%3A%5Cs%2B%28.%2B%29%24%2Fm'
    6     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    7     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.06 ms | 1385 KiB | 17 Q