3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '(foo|bar)/*'; $pattern = preg_quote($pattern, '#'); // Asterisks are translated into zero-or-more regular expression wildcards // to make it convenient to check if the strings starts with the given // pattern such as "library/*", making any string check convenient. $pattern = str_replace('\*', '.*', $pattern).'\z'; echo '#^'.$pattern.'#';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7OIIm
function name:  (null)
number of ops:  17
compiled vars:  !0 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%28foo%7Cbar%29%2F%2A'
    4     1        INIT_FCALL                                               'preg_quote'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%23'
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
    9     6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '%5C%2A'
          8        SEND_VAL                                                 '.%2A'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        CONCAT                                           ~5      $4, '%5Cz'
         12        ASSIGN                                                   !0, ~5
   11    13        CONCAT                                           ~7      '%23%5E', !0
         14        CONCAT                                           ~8      ~7, '%23'
         15        ECHO                                                     ~8
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.86 ms | 1399 KiB | 17 Q