summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/strpbrk_error.phpt
blob: 3d7f84e948bfbd3a196838d89f57a6688d922683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Test strpbrk() function : error conditions
--FILE--
<?php
$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 ($characters) must be a non-empty string