Annotation of embedaddon/php/ext/date/tests/gettimeofday_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test 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:
! 11: echo "*** Testing gettimeofday() : basic functionality ***\n";
! 12:
! 13: date_default_timezone_set("Asia/Calcutta");
! 14:
! 15: // Initialise all required variables
! 16: $get_as_float = true;
! 17:
! 18: // Calling gettimeofday() with all possible arguments
! 19: var_dump( gettimeofday($get_as_float) );
! 20:
! 21: // Calling gettimeofday() with mandatory arguments
! 22: var_dump( gettimeofday() );
! 23:
! 24: // Initialise all required variables
! 25: $get_as_float = false;
! 26:
! 27: // Calling gettimeofday() with all possible arguments
! 28: var_dump( gettimeofday($get_as_float) );
! 29:
! 30: ?>
! 31: ===DONE===
! 32: --EXPECTF--
! 33: *** Testing gettimeofday() : basic functionality ***
! 34: float(%f)
! 35: array(4) {
! 36: ["sec"]=>
! 37: int(%d)
! 38: ["usec"]=>
! 39: int(%d)
! 40: ["minuteswest"]=>
! 41: int(-330)
! 42: ["dsttime"]=>
! 43: int(0)
! 44: }
! 45: array(4) {
! 46: ["sec"]=>
! 47: int(%d)
! 48: ["usec"]=>
! 49: int(%d)
! 50: ["minuteswest"]=>
! 51: int(-330)
! 52: ["dsttime"]=>
! 53: int(0)
! 54: }
! 55: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>