- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
echo "\w without the \u flag should result in int(0) in all PHP versions\n";
var_dump(preg_match('/\w/', 'ä'));
echo "\n\w with the \u flag used to result in int(1) in PHP <7.3!\n";
var_dump(preg_match('/\w/u', 'ä'));
echo "\n\pL instead of \w used to result in int(1) in all PHP versions\n";
var_dump(preg_match('/\pL/u', 'ä'));