]> granicus.if.org Git - php/commitdiff
add test for strptime(): return false on failure
authorchance garcia <develop@chancegarcia.com>
Sun, 18 Jun 2017 16:28:31 +0000 (12:28 -0400)
committerSara Golemon <pollita@php.net>
Sun, 18 Jun 2017 16:28:50 +0000 (12:28 -0400)
Closes https://github.com/php/php-src/pull/2583

ext/standard/tests/time/strptime_error.phpt

index 92c7ca3474406a13d789b911b679032e65934af2..ae55028cb24d7e372ff655788c820fa2d5fdf0f2 100644 (file)
@@ -32,6 +32,9 @@ echo "\n-- Testing strptime() function with more than expected no. of arguments
 $extra_arg = 10;
 var_dump( strptime($date, $format, $extra_arg) );
 
+echo "\n-- Testing strptime() function on failure --\n";
+var_dump( strptime('foo', $format) );
+
 ?>
 ===DONE===
 --EXPECTF--
@@ -51,5 +54,8 @@ NULL
 
 Warning: strptime() expects exactly 2 parameters, 3 given in %s on line %d
 NULL
+
+-- Testing strptime() function on failure --
+bool(false)
 ===DONE===