mirror of
https://github.com/php/php-src.git
synced 2026-04-16 20:41:18 +02:00
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".
37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
--TEST--
|
|
Test getdate() function : usage variation - Passing high positive and negative float values to timestamp.
|
|
--SKIPIF--
|
|
<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
|
|
--FILE--
|
|
<?php
|
|
/* Prototype : array getdate([int timestamp])
|
|
* Description: Get date/time information
|
|
* Source code: ext/date/php_date.c
|
|
* Alias to functions:
|
|
*/
|
|
|
|
echo "*** Testing getdate() : usage variation ***\n";
|
|
date_default_timezone_set("Asia/Calcutta");
|
|
|
|
echo "\n-- Testing getdate() function by passing float 12.3456789000e10 value to timestamp --\n";
|
|
$timestamp = 12.3456789000e10;
|
|
var_dump( getdate($timestamp) );
|
|
|
|
echo "\n-- Testing getdate() function by passing float -12.3456789000e10 value to timestamp --\n";
|
|
$timestamp = -12.3456789000e10;
|
|
var_dump( getdate($timestamp) );
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
*** Testing getdate() : usage variation ***
|
|
|
|
-- Testing getdate() function by passing float 12.3456789000e10 value to timestamp --
|
|
|
|
Warning: getdate() expects parameter 1 to be int, float given in %s on line %d
|
|
bool(false)
|
|
|
|
-- Testing getdate() function by passing float -12.3456789000e10 value to timestamp --
|
|
|
|
Warning: getdate() expects parameter 1 to be int, float given in %s on line %d
|
|
bool(false)
|
|
===DONE===
|