mirror of
https://github.com/php/php-src.git
synced 2026-04-26 01:18:19 +02:00
bb6f374048
Closes GH-5198
24 lines
605 B
PHP
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
|