mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
ce1d69a1f6
PHP requires integer typehints to be written "int" and does not allow "integer" as an alias. This changes type error messages to match the actual type name and avoids confusing messages like "must be of the type integer, integer given".
40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
--TEST--
|
|
Test gmdate() function : usage variation - Passing high positive and negetive float values to timestamp.
|
|
--SKIPIF--
|
|
<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
|
|
--FILE--
|
|
<?php
|
|
/* Prototype : string gmdate(string format [, long timestamp])
|
|
* Description: Format a GMT date/time
|
|
* 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===
|
|
--EXPECTF--
|
|
*** Testing gmdate() : usage variation ***
|
|
|
|
-- Testing gmdate() function with float 12.3456789000e10 to timestamp --
|
|
|
|
Warning: gmdate() expects parameter 2 to be int, float given in %s on line %d
|
|
bool(false)
|
|
|
|
-- Testing gmdate() function with float -12.3456789000e10 to timestamp --
|
|
|
|
Warning: gmdate() expects parameter 2 to be int, float given in %s on line %d
|
|
bool(false)
|
|
===DONE===
|