3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = 'Test'; $existing = 'Test [2]'; $pattern = sprintf('/%s \[\d+\]/', preg_quote($source, '/')); var_dump(preg_match($pattern, $existing));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mX1MF
function name:  (null)
number of ops:  19
compiled vars:  !0 = $source, !1 = $existing, !2 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Test'
    4     1        ASSIGN                                                   !1, 'Test+%5B2%5D'
    5     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%2F%25s+%5C%5B%5Cd%2B%5C%5D%2F'
          4        INIT_FCALL                                               'preg_quote'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '%2F'
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
    6    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'preg_match'
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.71 ms | 1394 KiB | 21 Q