1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Files
archived-php-src/ext/standard/tests/strings/strpbrk_error.phpt
T
George Peter Banyard 501a72e354 Promote warning to value error in strpbrk()
Closes GH-4598
2019-11-22 00:36:54 +01:00

24 lines
577 B
PHP

--TEST--
Test strpbrk() function : error conditions
--FILE--
<?php
/* Prototype : array strpbrk(string haystack, string char_list)
* Description: Search a string for any of a set of characters
* Source code: ext/standard/string.c
* Alias to functions:
*/
$haystack = 'This is a Simple text.';
echo "-- Testing strpbrk() function with empty second argument --\n";
try {
strpbrk($haystack, '');
} catch (\ValueError $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
-- Testing strpbrk() function with empty second argument --
The character list cannot be empty