function PcreException::pcreLastErrorMessage
Parameters
int $code:
Return value
string
1 call to PcreException::pcreLastErrorMessage()
- PcreException::fromFunction in vendor/
composer/ pcre/ src/ PcreException.php
File
-
vendor/
composer/ pcre/ src/ PcreException.php, line 36
Class
Namespace
Composer\PcreCode
private static function pcreLastErrorMessage($code) {
if (function_exists('preg_last_error_msg')) {
return preg_last_error_msg();
}
$constants = get_defined_constants(true);
if (!isset($constants['pcre']) || !is_array($constants['pcre'])) {
return 'UNDEFINED_ERROR';
}
foreach ($constants['pcre'] as $const => $val) {
if ($val === $code && substr($const, -6) === '_ERROR') {
return $const;
}
}
return 'UNDEFINED_ERROR';
}