3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/([-]{1,2})(\\w+)/'; $str = "--argument"; preg_match($re, $str, $matches); var_dump($matches); echo $matches[1] === '--';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YfUiA
function name:  (null)
number of ops:  14
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2F%28%5B-%5D%7B1%2C2%7D%29%28%5Cw%2B%29%2F'
    3     1        ASSIGN                                                   !1, '--argument'
    5     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
    7    10        FETCH_DIM_R                                      ~7      !2, 1
         11        IS_IDENTICAL                                     ~8      ~7, '--'
         12        ECHO                                                     ~8
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
204.58 ms | 1394 KiB | 17 Q