2008-11-14 09:16:00 +00:00
|
|
|
--TEST--
|
|
|
|
Test gmdate() function : usage variation - Passing high positive and negetive float values to timestamp.
|
2014-09-22 22:01:08 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
|
2008-11-14 09:16:00 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
/* Prototype : string gmdate(string format [, long timestamp])
|
2018-10-14 15:45:48 +00:00
|
|
|
* Description: Format a GMT date/time
|
2008-11-14 09:16:00 +00:00
|
|
|
* Source code: ext/date/php_date.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
echo "*** Testing gmdate() : usage variation ***\n";
|
|
|
|
|
|
|
|
// Initialise all required variables
|
|
|
|
date_default_timezone_set('UTC');
|
|
|
|
$format = DATE_ISO8601;
|
|
|
|
|
|
|
|
echo "\n-- Testing gmdate() function with float 12.3456789000e10 to timestamp --\n";
|
|
|
|
$timestamp = 12.3456789000e10;
|
|
|
|
var_dump( gmdate($format, $timestamp) );
|
|
|
|
|
|
|
|
echo "\n-- Testing gmdate() function with float -12.3456789000e10 to timestamp --\n";
|
|
|
|
$timestamp = -12.3456789000e10;
|
|
|
|
var_dump( gmdate($format, $timestamp) );
|
|
|
|
|
|
|
|
?>
|
|
|
|
===DONE===
|
2014-09-22 21:47:28 +00:00
|
|
|
--EXPECTF--
|
|
|
|
*** Testing gmdate() : usage variation ***
|
2008-11-14 09:16:00 +00:00
|
|
|
|
2014-09-22 21:47:28 +00:00
|
|
|
-- Testing gmdate() function with float 12.3456789000e10 to timestamp --
|
2008-11-14 09:16:00 +00:00
|
|
|
|
2018-02-04 13:33:49 +00:00
|
|
|
Warning: gmdate() expects parameter 2 to be int, float given in %s on line %d
|
2014-09-22 21:47:28 +00:00
|
|
|
bool(false)
|
|
|
|
|
|
|
|
-- Testing gmdate() function with float -12.3456789000e10 to timestamp --
|
|
|
|
|
2018-02-04 13:33:49 +00:00
|
|
|
Warning: gmdate() expects parameter 2 to be int, float given in %s on line %d
|
2014-09-22 21:47:28 +00:00
|
|
|
bool(false)
|
2018-10-15 02:32:30 +00:00
|
|
|
===DONE===
|