3v4l.org

run code in 500+ PHP versions simultaneously
<?php $regex = 'test.'; // match print preg_match('/^'.$regex.'$/i', 'tests') ? 'match' : 'nomatch'; print PHP_EOL; // nomatch print preg_match('/^'.preg_quote($regex).'$/i', 'tests') ? 'match' : 'nomatch'; print PHP_EOL; // nomatch print preg_match('/^\Q'.$regex.'\E$/i', 'tests') ? 'match' : 'nomatch'; print PHP_EOL; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
Branch analysis from position: 28
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
Branch analysis from position: 19
filename:       /in/oTFal
function name:  (null)
number of ops:  32
compiled vars:  !0 = $regex
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'test.'
    5     1        CONCAT                                               ~2      '%2F%5E', !0
          2        CONCAT                                               ~3      ~2, '%24%2Fi'
          3        FRAMELESS_ICALL_2                preg_match          ~4      ~3, 'tests'
          4      > JMPZ                                                         ~4, ->7
          5    >   QM_ASSIGN                                            ~5      'match'
          6      > JMP                                                          ->8
          7    >   QM_ASSIGN                                            ~5      'nomatch'
          8    >   ECHO                                                         ~5
    6     9        ECHO                                                         '%0A'
    9    10        INIT_FCALL                                                   'preg_quote'
         11        SEND_VAR                                                     !0
         12        DO_ICALL                                             $6      
         13        CONCAT                                               ~7      '%2F%5E', $6
         14        CONCAT                                               ~8      ~7, '%24%2Fi'
         15        FRAMELESS_ICALL_2                preg_match          ~9      ~8, 'tests'
         16      > JMPZ                                                         ~9, ->19
         17    >   QM_ASSIGN                                            ~10     'match'
         18      > JMP                                                          ->20
         19    >   QM_ASSIGN                                            ~10     'nomatch'
         20    >   ECHO                                                         ~10
   10    21        ECHO                                                         '%0A'
   13    22        CONCAT                                               ~11     '%2F%5E%5CQ', !0
         23        CONCAT                                               ~12     ~11, '%5CE%24%2Fi'
         24        FRAMELESS_ICALL_2                preg_match          ~13     ~12, 'tests'
         25      > JMPZ                                                         ~13, ->28
         26    >   QM_ASSIGN                                            ~14     'match'
         27      > JMP                                                          ->29
         28    >   QM_ASSIGN                                            ~14     'nomatch'
         29    >   ECHO                                                         ~14
   14    30        ECHO                                                         '%0A'
   15    31      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
179.43 ms | 1536 KiB | 14 Q