1--TEST--
2Test localtime() function : usage variation - Passing higher positive and negetive float values to timestamp.
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 4) echo "skip this test is for 32-bit only"; ?>
5--FILE--
6<?php
7/* Prototype  : array localtime([int timestamp [, bool associative_array]])
8 * Description: Returns the results of the C system call localtime as an associative array
9 * if the associative_array argument is set to 1 other wise it is a regular array
10 * Source code: ext/date/php_date.c
11 * Alias to functions:
12 */
13
14echo "*** Testing localtime() : usage variation ***\n";
15
16date_default_timezone_set("UTC");
17// Initialise function arguments not being substituted (if any)
18$is_associative = true;
19
20echo "\n-- Testing localtime() function with 'float 12.3456789000e10' to timestamp --\n";
21$timestamp = 12.3456789000e10;
22var_dump( localtime($timestamp) );
23var_dump( localtime($timestamp, $is_associative) );
24
25echo "\n-- Testing localtime() function with 'float -12.3456789000e10' to timestamp --\n";
26$timestamp = -12.3456789000e10;
27var_dump( localtime($timestamp) );
28var_dump( localtime($timestamp, $is_associative) );
29
30?>
31===DONE===
32--EXPECTF--
33*** Testing localtime() : usage variation ***
34
35-- Testing localtime() function with 'float 12.3456789000e10' to timestamp --
36
37Warning: localtime() expects parameter 1 to be integer, float given in %s on line %d
38bool(false)
39
40Warning: localtime() expects parameter 1 to be integer, float given in %s on line %d
41bool(false)
42
43-- Testing localtime() function with 'float -12.3456789000e10' to timestamp --
44
45Warning: localtime() expects parameter 1 to be integer, float given in %s on line %d
46bool(false)
47
48Warning: localtime() expects parameter 1 to be integer, float given in %s on line %d
49bool(false)
50===DONE===
51