1--TEST-- 2Test gmmktime() function : usage variation - Passing positive and negative float values to arguments 32 bits. 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) die('skip 32 bit only'); 6?> 7--FILE-- 8<?php 9echo "*** Testing gmmktime() : usage variation ***\n"; 10 11//Initialise variables 12$hour = 8; 13$min = 8; 14$sec = 8; 15$mon = 8; 16$day = 8; 17$year = 2008; 18 19$inputs = array( 20 21 'float 123456' => 123456, 22 'float -123456' => -123456, 23 'float -10.5' => -10.5, 24); 25 26// loop through each element of the array for min 27foreach($inputs as $key =>$value) { 28 echo "\n--$key--\n"; 29 var_dump( gmmktime($value, $min, $sec, $mon, $day, $year) ); 30 var_dump( gmmktime($hour, $value, $sec, $mon, $day, $year) ); 31 var_dump( gmmktime($hour, $min, $value, $mon, $day, $year) ); 32 var_dump( gmmktime($hour, $min, $sec, $value, $day, $year) ); 33 var_dump( gmmktime($hour, $min, $sec, $mon, $value, $value) ); 34} 35?> 36--EXPECTF-- 37*** Testing gmmktime() : usage variation *** 38 39--float 123456-- 40int(1662595688) 41int(1225589768) 42int(1218306336) 43 44Warning: gmmktime(): Epoch doesn't fit in a PHP integer in %s on line %d 45bool(false) 46 47Warning: gmmktime(): Epoch doesn't fit in a PHP integer in %s on line %d 48bool(false) 49 50--float -123456-- 51int(773712488) 52int(1210775048) 53int(1218059424) 54 55Warning: gmmktime(): Epoch doesn't fit in a PHP integer in %s on line %d 56bool(false) 57 58Warning: gmmktime(): Epoch doesn't fit in a PHP integer in %s on line %d 59bool(false) 60 61--float -10.5-- 62int(1218118088) 63int(1218181808) 64int(1218182870) 65int(1170922088) 66 67Warning: gmmktime(): Epoch doesn't fit in a PHP integer in %s on line %d 68bool(false) 69