summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/strpbrk_error.phpt
blob: 075e0b246261ec7dad7730c8b28d82b77880b8e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--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:
 */

echo "*** Testing strpbrk() : error conditions ***\n";

$haystack = 'This is a Simple text.';

echo "\n-- Testing strpbrk() function with empty second argument --\n";
var_dump( strpbrk($haystack, '') );

?>
--EXPECTF--
*** Testing strpbrk() : error conditions ***

-- Testing strpbrk() function with empty second argument --

Warning: strpbrk(): The character list cannot be empty in %s on line %d
bool(false)