Warning: Division by zero in /var/customers/webs/stc/benchmark/index.php on line 256 Test: strftime vs. localtime

PHP Benchmarks

Performance comparison of PHP code alternatives.

Test: strftime() vs. localtime()

Run Again Test Menu

Result

Unfortunately, no history for this test is available.

Code

The first test, "strftime()", was:

for ($i = 0; $i < 100; $i++)
	$GLOBALS['dummy'] = (int) strftime('%d', $GLOBALS['t']);

The second test, "localtime()", was:

for ($i = 0; $i < 100; $i++)
{
	$temp = localtime($GLOBALS['t'], true);
	$GLOBALS['dummy'] = $temp['tm_mday'];
}

Running: Linux (x86_64:1 GB) PHP (7.2.25-1+ubuntu16.04.1+deb.sury.org+1)