1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00
Files
archived-php-src/ext/standard/tests/strings/strpbrk_error.phpt
T
2020-03-18 19:56:10 +01:00

24 lines
605 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 --
strpbrk(): Argument #2 ($char_list) must be a non-empty string