src/Gobie/Regex/Wrappers/Pcre/PcreRegex.php
protected static function setUp($pattern)
    {
        \set_error_handler(function ($errno, $errstr) use ($pattern) {
            \restore_error_handler();
            throw new PcreRegexException($errstr, null, $pattern);
        });
    }
protected static function setUp($pattern)
    {
        \set_error_handler(function ($errno, $errstr) use ($pattern) {
            \restore_error_handler();
            throw new PcreRegexException($errstr, null, $pattern);
        });
    }
Prepare error handler for catching compilation errors.

@param string|string[] $pattern Pattern or array of patterns