3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); for($i = 0; $i < 1000; $i++) { $alreadyOutput = array(); foreach ($results as $result) { if(in_array($result->date, $alreadyOutput)){ continue; } $alreadyOutput[] = $result->date; echo $result->date . "<br />"; } } echo "in_array: ".(microtime(true) - $start)."ms || "; $start2 = microtime(true); for($i = 0; $i < 1000; $i++) { $echoedArray = array(); foreach ($results as $result) { if ($echoedArray[$result->date]) { continue; } echo $result->date . "<br />"; $echoedArray[$result->date] = true; } } echo "by key: ".(microtime(true) - $start2)."ms";

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)
7.1.70.0100.00316.93
7.1.60.0060.00617.46
7.1.50.0120.00017.04
7.1.40.0070.00716.53
7.1.30.0070.00716.72
7.1.20.0000.01316.82
7.1.10.0040.00418.68
7.1.00.0060.00618.68
7.0.200.0030.00616.66
7.0.190.0030.00516.77
7.0.180.0000.01116.49
7.0.170.0040.00416.31
7.0.160.0040.00416.32
7.0.150.0000.01318.68
7.0.140.0030.00518.68
7.0.130.0000.00918.68
7.0.120.0000.00818.68
7.0.110.0000.01118.68
7.0.100.0040.00418.68
7.0.90.0040.00418.68
7.0.80.0000.00718.68
7.0.70.0000.00818.68
7.0.60.0080.00018.68
7.0.50.0060.00618.68
7.0.40.0040.00418.98
7.0.30.0050.00218.98
7.0.20.0040.00418.98
7.0.10.0000.01018.98
7.0.00.0040.00418.98
5.6.300.0100.03820.84
5.6.290.0030.04420.62
5.6.280.0100.03920.89
5.6.270.0100.04120.89
5.6.260.0030.04320.78
5.6.250.0100.04021.09
5.6.240.0030.04420.84
5.6.230.0130.04720.82
5.6.220.0130.03520.94
5.6.210.0060.04121.06
5.6.200.0160.03321.04
5.6.190.0070.04220.99
5.6.180.0000.05620.86
5.6.170.0200.04820.83
5.6.160.0100.04020.99
5.6.150.0130.03820.82
5.6.140.0070.04121.04
5.6.130.0070.05820.93
5.6.120.0100.04020.86
5.6.110.0030.04420.82
5.6.100.0100.05120.94
5.6.90.0060.03820.98
5.6.80.0000.05620.43
5.6.70.0030.04720.20
5.6.60.0100.03820.41
5.6.50.0130.03320.39
5.6.40.0000.04520.13
5.6.30.0100.04220.19
5.6.20.0000.04520.09
5.6.10.0130.05320.28
5.6.00.0070.03720.30
5.5.380.0070.04018.68
5.5.370.0090.03718.68
5.5.360.0000.05218.68
5.5.350.0060.04518.68
5.5.340.0110.03918.68
5.5.330.0000.04818.98
5.5.320.0110.03718.98
5.5.310.0130.03518.98
5.5.300.0040.04618.98
5.5.290.0230.04618.98
5.5.280.0060.04618.98
5.5.270.0070.04118.98
5.5.260.0030.04318.98
5.5.250.0000.05218.98
5.5.240.0100.04218.98
5.5.230.0070.03918.98
5.5.220.0000.05118.98
5.5.210.0070.03718.98
5.5.200.0070.04818.98
5.5.190.0000.04418.98
5.5.180.0000.06318.98
5.5.160.0070.03718.98
5.5.150.0190.06118.98
5.5.140.0070.05418.98
5.5.130.0000.05018.98
5.5.120.0060.06718.98
5.5.110.0070.04018.98
5.5.100.0070.04318.98
5.5.90.0070.04018.98
5.5.80.0040.04018.98
5.5.70.0120.03118.98
5.5.60.0060.04518.98
5.5.50.0000.04718.98
5.5.40.0070.04118.98
5.5.30.0070.03818.98
5.5.20.0060.04118.98
5.5.10.0070.03718.98
5.5.00.0100.05918.98
5.4.450.0100.04619.32
5.4.440.0000.04619.20
5.4.430.0100.03519.18
5.4.420.0130.03719.18
5.4.410.0030.05619.28
5.4.400.0130.03219.12
5.4.390.0000.04618.98
5.4.380.0070.04618.98
5.4.370.0070.04518.98
5.4.360.0060.04418.98
5.4.350.0130.03418.98
5.4.340.0110.04619.02
5.4.320.0070.06319.00
5.4.310.0030.07819.01
5.4.300.0030.04418.98
5.4.290.0170.03318.98
5.4.280.0070.08219.01
5.4.270.0070.03919.00
5.4.260.0040.04318.98
5.4.250.0060.03718.98
5.4.240.0030.05418.98
5.4.230.0030.04818.98
5.4.220.0090.03518.98
5.4.210.0030.04418.98
5.4.200.0030.04118.98
5.4.190.0000.04918.98
5.4.180.0060.03819.07
5.4.170.0040.04019.09
5.4.160.0000.08719.00
5.4.150.0070.08019.09
5.4.140.0070.03918.98
5.4.130.0030.03718.98
5.4.120.0100.03418.98
5.4.110.0030.03918.98
5.4.100.0000.04018.98
5.4.90.0100.03218.98
5.4.80.0100.03218.98
5.4.70.0060.03918.98
5.4.60.0030.03718.98
5.4.50.0180.03718.98
5.4.40.0030.03718.98
5.4.30.0120.04718.98
5.4.20.0060.03518.98
5.4.10.0030.04318.98
5.4.00.0070.03418.98

preferences:
28.43 ms | 401 KiB | 5 Q