1--TEST-- 2Test gettimeofday() function : basic functionality 3--FILE-- 4<?php 5/* Prototype : array gettimeofday([bool get_as_float]) 6 * Description: Returns the current time as array 7 * Source code: ext/standard/microtime.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing gettimeofday() : basic functionality ***\n"; 12 13date_default_timezone_set("Asia/Calcutta"); 14 15// Initialise all required variables 16$get_as_float = true; 17 18// Calling gettimeofday() with all possible arguments 19var_dump( gettimeofday($get_as_float) ); 20 21// Calling gettimeofday() with mandatory arguments 22var_dump( gettimeofday() ); 23 24// Initialise all required variables 25$get_as_float = false; 26 27// Calling gettimeofday() with all possible arguments 28var_dump( gettimeofday($get_as_float) ); 29 30?> 31===DONE=== 32--EXPECTF-- 33*** Testing gettimeofday() : basic functionality *** 34float(%f) 35array(4) { 36 ["sec"]=> 37 int(%d) 38 ["usec"]=> 39 int(%d) 40 ["minuteswest"]=> 41 int(-330) 42 ["dsttime"]=> 43 int(0) 44} 45array(4) { 46 ["sec"]=> 47 int(%d) 48 ["usec"]=> 49 int(%d) 50 ["minuteswest"]=> 51 int(-330) 52 ["dsttime"]=> 53 int(0) 54} 55===DONE=== 56