File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -6114,8 +6114,8 @@ PHP_FUNCTION(strpbrk)
6114
6114
ZEND_PARSE_PARAMETERS_END_EX (RETURN_FALSE );
6115
6115
6116
6116
if (!ZSTR_LEN (char_list )) {
6117
- php_error_docref (NULL , E_WARNING , "The character list cannot be empty" );
6118
- RETURN_FALSE ;
6117
+ zend_throw_error (NULL , "The character list cannot be empty" );
6118
+ return ;
6119
6119
}
6120
6120
6121
6121
for (haystack_ptr = ZSTR_VAL (haystack ); haystack_ptr < (ZSTR_VAL (haystack ) + ZSTR_LEN (haystack )); ++ haystack_ptr ) {
Original file line number Diff line number Diff line change @@ -8,20 +8,19 @@ Test strpbrk() function : error conditions
8
8
* Alias to functions:
9
9
*/
10
10
11
- echo "*** Testing strpbrk() : error conditions *** \n" ;
12
-
13
11
$ haystack = 'This is a Simple text. ' ;
14
12
15
- echo "\n-- Testing strpbrk() function with empty second argument -- \n" ;
16
- var_dump ( strpbrk ($ haystack , '' ) );
13
+ echo "-- Testing strpbrk() function with empty second argument -- \n" ;
14
+
15
+ try {
16
+ strpbrk ($ haystack , '' );
17
+ } catch (\Error $ e ) {
18
+ echo $ e ->getMessage () . "\n" ;
19
+ }
17
20
18
21
?>
19
22
===DONE===
20
23
--EXPECTF--
21
- *** Testing strpbrk() : error conditions ***
22
-
23
24
-- Testing strpbrk() function with empty second argument --
24
-
25
- Warning: strpbrk(): The character list cannot be empty in %s on line %d
26
- bool(false)
25
+ The character list cannot be empty
27
26
===DONE===
You can’t perform that action at this time.
0 commit comments