3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $compare = '\d'; $value = 12345; $pattern = preg_quote($compare); var_dump( (bool) preg_match('~'.$pattern.'~iu', $value) ); var_dump( (bool) preg_match('~\\'.$compare.'~iu', $value) ); var_dump( (bool) preg_match('~\\d~iu', $value) );
based on FqjcW
Output for 5.6.0 - 7.3.0alpha1
bool(false) bool(false) bool(true)