3v4l.org

run code in 300+ PHP versions simultaneously
<?php $isset = true; $array = array(); $notSetArray = array(0=>''); $string = ''; // Test Source function TestEmpty() { $array = null; $i = 0; * The Test * $t = microtime(true); while($i < 2000) { empty($array); ++$i; } echo (microtime(true) - $t); } function TestEmpty2() { $array = array(); $i = 0; * The Test * $t = microtime(true); while($i < 2000) { (! $array ); ++$i; } echo (microtime(true) - $t); } function TestEmpty3() { $array = array(); $i = 0; * The Test * $t = microtime(true); while($i < 2000) { ($array !== []); ++$i; } echo (microtime(true) - $t); } TestEmpty(); echo "\n\n"; TestEmpty2(); echo "\n\n"; TestEmpty3();

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.280.0110.10512.38
5.4.270.0200.06512.38
5.4.260.0070.04412.38
5.4.250.0080.03812.38
5.4.240.0070.03912.38
5.4.230.0100.04212.38
5.4.220.0070.03712.38
5.4.210.0080.03512.38
5.4.200.0090.03712.38
5.4.190.0060.04512.37
5.4.180.0230.08112.37
5.4.170.0190.07812.38
5.4.160.0120.05812.37
5.4.150.0110.05612.37
5.4.140.0110.06412.06
5.4.130.0280.08012.04
5.4.120.0290.08012.00
5.4.110.0300.09012.00
5.4.100.0230.08312.00
5.4.90.0170.07012.00
5.4.80.0110.08912.01
5.4.70.0170.08112.00
5.4.60.0130.05912.00
5.4.50.0190.08212.00
5.4.40.0070.05311.99
5.4.30.0150.08011.98
5.4.20.0150.06511.98
5.4.10.0100.03811.98
5.4.00.0110.03511.48
5.3.280.0130.06312.71
5.3.270.0090.05012.72
5.3.260.0070.04312.72
5.3.250.0100.03812.71
5.3.240.0080.04412.72
5.3.230.0090.04112.71
5.3.220.0070.04712.68
5.3.210.0090.04612.68
5.3.200.0100.04412.68
5.3.190.0290.08812.68
5.3.180.0120.05012.67
5.3.170.0070.04212.67
5.3.160.0160.03512.67
5.3.150.0100.03912.67
5.3.140.0110.05812.66
5.3.130.0180.05512.66
5.3.120.0230.08912.66
5.3.110.0200.07812.66
5.3.100.0120.09712.12
5.3.90.0110.07812.08
5.3.80.0080.05212.08
5.3.70.0110.04412.08
5.3.60.0130.05612.07
5.3.50.0160.06112.00
5.3.40.0090.06612.00
5.3.30.0190.05911.95
5.3.20.0130.05911.73
5.3.10.0130.05311.70
5.3.00.0090.06711.70

preferences:
137.59 ms | 1394 KiB | 7 Q