mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

Provides the last PCRE error as a human-readable message, similar to functionality existing in other extensions, such as json_last_error_msg(). Closes GH-5185.
13 lines
293 B
PHP
13 lines
293 B
PHP
--TEST--
|
|
Test preg_match() function : error conditions - Internal error
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(preg_match('/', 'Hello world'));
|
|
var_dump(preg_last_error_msg() === 'Internal error');
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: preg_match(): No ending delimiter '/' found in %s on line %d
|
|
bool(false)
|
|
bool(true)
|