Skip to content

Commit d3c593a

Browse files
chancegarciasgolemon
authored andcommitted
add test for strptime(): return false on failure
Closes #2583
1 parent 192b2d8 commit d3c593a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/standard/tests/time/strptime_error.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ echo "\n-- Testing strptime() function with more than expected no. of arguments
3232
$extra_arg = 10;
3333
var_dump( strptime($date, $format, $extra_arg) );
3434

35+
echo "\n-- Testing strptime() function on failure --\n";
36+
var_dump( strptime('foo', $format) );
37+
3538
?>
3639
===DONE===
3740
--EXPECTF--
@@ -51,5 +54,8 @@ NULL
5154

5255
Warning: strptime() expects exactly 2 parameters, 3 given in %s on line %d
5356
NULL
57+
58+
-- Testing strptime() function on failure --
59+
bool(false)
5460
===DONE===
5561

0 commit comments

Comments
 (0)