3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $kw = " asdsdfsdf \xFF as "; $pattern = '/[[:cntrl:]' . preg_quote(',!@%^*()={};~`<>?\|', '/') . ']/u'; var_dump($pattern); var_dump(var_export($pattern, true)); var_dump(preg_match($pattern, $kw));
based on odUuD
Output for 5.3.4 - 7.2.0
string(46) "/[[:cntrl:],\!@%\^\*\(\)\=\{\};~`\<\>\?\\\|]/u" string(62) "'/[[:cntrl:],\\!@%\\^\\*\\(\\)\\=\\{\\};~`\\<\\>\\?\\\\\\|]/u'" bool(false)
Output for 4.3.0 - 5.3.3
string(46) "/[[:cntrl:],\!@%\^\*\(\)\=\{\};~`\<\>\?\\\|]/u" string(62) "'/[[:cntrl:],\\!@%\\^\\*\\(\\)\\=\\{\\};~`\\<\\>\\?\\\\\\|]/u'" int(0)