3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $results = array(); for($i = 0; $i < 100000; $i++) { $results[] = (object) rand(0, 100000); } $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 "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; } $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.0732.42861.05
7.1.60.0202.35361.71
7.1.50.0072.49561.38
7.1.00.0202.48066.69
7.0.200.4532.00361.82
7.0.140.0132.48770.26
7.0.60.0272.47366.98
7.0.50.0172.48364.64
7.0.40.0102.49023.55
7.0.30.0432.45723.46
7.0.20.0372.46323.69
7.0.10.0372.46323.52
7.0.00.0102.49023.45
5.6.280.0202.48078.12
5.6.210.0272.47775.98
5.6.200.4672.03373.63
5.6.190.0302.47375.64
5.6.180.0272.47375.80
5.6.170.0272.47375.71
5.6.160.0272.47775.70
5.6.150.0332.46773.55
5.6.140.0302.47373.50
5.6.130.0272.47773.55
5.6.120.0172.48376.60
5.6.110.0232.48076.43
5.6.100.0432.46076.55
5.6.90.0332.46776.42
5.6.80.0172.48375.85
5.6.70.4832.01775.87
5.5.350.0232.47776.92
5.5.340.0232.47773.45
5.5.330.0302.47375.60
5.5.320.0702.43375.54
5.5.310.0602.44075.50
5.5.300.0202.48373.30
5.5.290.0372.46773.42
5.5.280.0202.48076.15
5.5.270.0102.49076.11
5.5.260.0372.46376.41
5.5.250.0272.47776.05
5.5.240.0202.48375.70
5.4.450.0602.43774.50
5.4.440.4802.01774.66
5.4.430.0402.45774.89
5.4.420.0402.45774.75
5.4.410.4902.00774.66
5.4.400.0332.46774.48
5.4.390.3602.13774.61
5.4.380.0532.44774.43
5.4.370.0502.44774.31
5.4.360.0702.43074.48
5.4.350.0402.45774.47
5.4.340.0132.48374.96
5.4.320.0361.96967.93
5.4.310.0281.97767.93
5.4.300.0291.97467.93
5.4.290.0271.97767.93
5.4.280.0211.98267.82
5.4.270.0271.97567.82
5.4.260.0281.97567.82
5.4.250.0141.99067.82
5.4.240.0321.97367.82
5.4.230.0181.99267.82
5.4.220.0211.98867.81
5.4.210.0231.98067.81
5.4.200.0201.98667.81
5.4.190.0271.97667.81
5.4.180.0281.97567.81
5.4.170.0231.97967.81
5.4.160.0472.45374.44
5.4.150.5171.98074.44
5.4.140.5271.97071.67
5.4.130.0372.46371.68
5.4.120.0432.45371.76
5.4.110.0472.45371.52
5.4.100.0302.47073.07
5.4.90.0372.46371.73
5.4.80.0302.47073.29
5.4.70.0332.46373.66
5.4.60.0272.47073.21
5.4.50.0102.48773.55
5.4.40.0272.47073.85
5.4.30.0332.46371.71
5.4.20.0272.47071.88
5.4.10.3932.10371.92
5.4.00.4872.01071.23

preferences:
31.81 ms | 400 KiB | 5 Q