3v4l.org

run code in 500+ PHP versions simultaneously
<?php preg_match("#[\w()-]#", 'some text'); // ok preg_match("#[-\w()]#", 'some text'); // ok preg_match("#[\w-()]#", 'some text'); // NOPE! preg_match("#[\w(-)]#", 'some text'); // ok
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dRG8U
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   FRAMELESS_ICALL_2                preg_match          ~0      '%23%5B%5Cw%28%29-%5D%23', 'some+text'
          1        FREE                                                         ~0
    4     2        FRAMELESS_ICALL_2                preg_match          ~1      '%23%5B-%5Cw%28%29%5D%23', 'some+text'
          3        FREE                                                         ~1
    5     4        FRAMELESS_ICALL_2                preg_match          ~2      '%23%5B%5Cw-%28%29%5D%23', 'some+text'
          5        FREE                                                         ~2
    6     6        FRAMELESS_ICALL_2                preg_match          ~3      '%23%5B%5Cw%28-%29%5D%23', 'some+text'
          7        FREE                                                         ~3
          8      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
202.96 ms | 2590 KiB | 13 Q