fix test, particularly when running with valgrind, bacause it may take more than one second to execute both instructions and thus get different dates

This commit is contained in:
Nuno Lopes 2007-09-13 19:58:26 +00:00
parent b0e393e543
commit bb2ec1c790

View file

@ -4,8 +4,9 @@ Bug #35885 (strtotime("NOW") no longer works)
<?php <?php
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");
$ts = date(DATE_ISO8601, strtotime('NOW')); $time = time();
$ts2 = date(DATE_ISO8601, time()); $ts = date(DATE_ISO8601, strtotime('NOW', $time));
$ts2 = date(DATE_ISO8601, $time);
$res = ($ts == $ts2); $res = ($ts == $ts2);
var_dump($res); var_dump($res);