<?php
set_error_handler(function ($_, $errstr) {
restore_error_handler();
echo 'handler:' . var_export($errstr, true) . \PHP_EOL;
});
echo 'execution:' . \var_export(\preg_match('//u', "\xc3\x28"), true) . \PHP_EOL;
echo 'error:' . var_export(\preg_last_error(), true) . \PHP_EOL;
echo 'compilation:' . \var_export(\preg_match('/(/', 'a'), true) . \PHP_EOL;
echo 'error:' . var_export(\preg_last_error(), true) . \PHP_EOL;
\restore_error_handler();
echo 'ok:' . var_export(\preg_match('/./', 'a'), true) . \PHP_EOL;
echo 'error:' . var_export(\preg_last_error(), true) . \PHP_EOL;
preferences:
76.07 ms | 402 KiB | 5 Q