3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151 ms | 1395 KiB | 17 Q