ZEND_PARSE_PARAMETERS_END();
if (!ZSTR_LEN(char_list)) {
- php_error_docref(NULL, E_WARNING, "The character list cannot be empty");
- RETURN_FALSE;
+ zend_value_error("The character list cannot be empty");
+ return;
}
for (haystack_ptr = ZSTR_VAL(haystack); haystack_ptr < (ZSTR_VAL(haystack) + ZSTR_LEN(haystack)); ++haystack_ptr) {
* 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, '') );
+echo "-- Testing strpbrk() function with empty second argument --\n";
+try {
+ strpbrk($haystack, '');
+} catch (\ValueError $e) {
+ echo $e->getMessage() . "\n";
+}
?>
---EXPECTF--
-*** Testing strpbrk() : error conditions ***
-
+--EXPECT--
-- Testing strpbrk() function with empty second argument --
-
-Warning: strpbrk(): The character list cannot be empty in %s on line %d
-bool(false)
+The character list cannot be empty