3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'this is test'; preg_match('/(?P<test>.+)/', $string, $matches); // basic syntax var_dump($matches['test']); preg_match('/(?<test>.+)/', $string, $matches); // alternative var_dump($matches['test']); preg_match("/(?'test'.+)/", $string, $matches); // alternative var_dump($matches['test']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/84q9T
function name:  (null)
number of ops:  29
compiled vars:  !0 = $string, !1 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'this+is+test'
    5     1        INIT_FCALL                                                   'preg_match'
          2        SEND_VAL                                                     '%2F%28%3FP%3Ctest%3E.%2B%29%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    6     6        INIT_FCALL                                                   'var_dump'
          7        FETCH_DIM_R                                          ~4      !1, 'test'
          8        SEND_VAL                                                     ~4
          9        DO_ICALL                                                     
    8    10        INIT_FCALL                                                   'preg_match'
         11        SEND_VAL                                                     '%2F%28%3F%3Ctest%3E.%2B%29%2F'
         12        SEND_VAR                                                     !0
         13        SEND_REF                                                     !1
         14        DO_ICALL                                                     
    9    15        INIT_FCALL                                                   'var_dump'
         16        FETCH_DIM_R                                          ~7      !1, 'test'
         17        SEND_VAL                                                     ~7
         18        DO_ICALL                                                     
   11    19        INIT_FCALL                                                   'preg_match'
         20        SEND_VAL                                                     '%2F%28%3F%27test%27.%2B%29%2F'
         21        SEND_VAR                                                     !0
         22        SEND_REF                                                     !1
         23        DO_ICALL                                                     
   12    24        INIT_FCALL                                                   'var_dump'
         25        FETCH_DIM_R                                          ~10     !1, 'test'
         26        SEND_VAL                                                     ~10
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.19 ms | 3377 KiB | 15 Q