File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / date / tests / gettimeofday_basic.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:54 2012 UTC (13 years, 3 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
Test gettimeofday() function : basic functionality 
--FILE--
<?php
/* Prototype  : array gettimeofday([bool get_as_float])
 * Description: Returns the current time as array 
 * Source code: ext/standard/microtime.c
 * Alias to functions: 
 */

echo "*** Testing gettimeofday() : basic functionality ***\n";

date_default_timezone_set("Asia/Calcutta");

// Initialise all required variables
$get_as_float = true;

// Calling gettimeofday() with all possible arguments
var_dump( gettimeofday($get_as_float) );

// Calling gettimeofday() with mandatory arguments
var_dump( gettimeofday() );

// Initialise all required variables
$get_as_float = false;

// Calling gettimeofday() with all possible arguments
var_dump( gettimeofday($get_as_float) );

?>
===DONE===
--EXPECTF--
*** Testing gettimeofday() : basic functionality ***
float(%f)
array(4) {
  ["sec"]=>
  int(%d)
  ["usec"]=>
  int(%d)
  ["minuteswest"]=>
  int(-330)
  ["dsttime"]=>
  int(0)
}
array(4) {
  ["sec"]=>
  int(%d)
  ["usec"]=>
  int(%d)
  ["minuteswest"]=>
  int(-330)
  ["dsttime"]=>
  int(0)
}
===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>