3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'bar'; $matches = []; preg_match('~(?|foo(*:1) |bar(*:2) |baz(*:3))~x', $string, $matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ErCrp
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'bar'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%7E%28%3F%7Cfoo%28%2A%3A1%29%0A+++++++++++++++%7Cbar%28%2A%3A2%29%0A+++++++++++++++%7Cbaz%28%2A%3A3%29%29%7Ex'
    8     4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
    6     6        DO_ICALL                                                 
   10     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.32 ms | 1001 KiB | 15 Q