mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +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.
12 lines
262 B
PHP
12 lines
262 B
PHP
--TEST--
|
|
Test preg_split() function : error conditions - Malformed UTF-8
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(preg_split('/a/u', "a\xff"));
|
|
var_dump(preg_last_error_msg() === 'Malformed UTF-8 characters, possibly incorrectly encoded');
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|
|
bool(true)
|