3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar; public function __construct() { $this->bar = rand(0, 1); } public function getBar() { return $this->bar; } } $quux = array(); for ($i=0; $i<10; $i++){ $quux[] = new Foo(); } foreach ($quux as $k => $v) { if ($v->getBar()) { unset($quux[$k]); } } print_r($quux); $qwax = array(); foreach ($quux as $q) { if ( ! $q->getBar()) { $qwax[] = $q; } } print_r($qwax);

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.3.10.0020.01316.70
7.3.00.0060.00716.74
7.2.130.0030.00816.94
7.2.120.0050.00616.99
7.2.110.0110.00517.03
7.2.100.0050.00616.86
7.2.90.0040.01017.03
7.2.80.0070.01016.98
7.2.70.0030.01316.97
7.2.60.0040.00716.94
7.2.50.0080.00517.10
7.2.40.0050.00816.97
7.2.30.0100.00216.92
7.2.20.0050.00916.83
7.2.10.0070.00716.87
7.2.00.0060.00717.76
7.1.250.0050.00615.76
7.1.70.0040.00417.36
7.1.60.0030.01319.70
7.1.50.0030.00917.01
7.1.00.0000.07722.44
7.0.200.0070.00016.18
7.0.140.0030.07022.09
7.0.60.0070.04719.88
7.0.50.0100.07017.84
7.0.40.0070.05320.27
7.0.30.0300.07720.03
7.0.20.0270.08320.09
7.0.10.0330.07720.33
7.0.00.0170.07720.14
5.6.280.0070.07021.13
5.6.210.0070.05720.77
5.6.200.0100.08718.22
5.6.190.0100.08320.42
5.6.180.0070.08020.68
5.6.170.0270.08720.57
5.6.160.0100.05720.54
5.6.150.0130.07318.27
5.6.140.0030.04018.21
5.6.130.0030.07718.16
5.6.120.0100.05020.99
5.6.110.0030.04321.04
5.6.100.0070.04021.14
5.6.90.0100.06321.11
5.6.80.0030.06720.48
5.5.350.0030.08720.42
5.5.340.0030.03717.95
5.5.330.0030.08320.19
5.5.320.0200.06720.34
5.5.310.0370.05720.41
5.5.300.0070.04318.07
5.5.290.0070.06017.98
5.5.280.0030.08320.98
5.5.270.0100.03720.77
5.5.260.0030.07020.84
5.5.250.0070.08320.80
5.5.240.0100.07720.05
5.4.450.0200.04033.61
5.4.440.0700.03731.26
5.4.430.0270.05029.32
5.4.420.0670.03329.30
5.4.410.0230.04029.29
5.4.400.0300.04729.25
5.4.390.0100.05026.93
5.4.380.0230.04718.76
5.4.370.0130.05318.50
5.4.360.0130.07018.78
5.4.350.0230.04718.48
5.4.340.0100.05318.54
5.4.320.0050.04112.50
5.4.310.0080.04612.50
5.4.300.0060.03912.50
5.4.290.0040.04212.50
5.4.280.0060.03512.39
5.4.270.0070.03612.39
5.4.260.0060.03912.40
5.4.250.0040.04012.40
5.4.240.0100.04312.40
5.4.230.0090.04512.39
5.4.220.0090.05012.39
5.4.210.0050.03712.39
5.4.200.0100.04512.39
5.4.190.0060.03712.39
5.4.180.0080.03612.39
5.4.170.0090.04512.39
5.4.160.0080.04612.40
5.4.150.0120.03812.39
5.4.140.0100.04212.07
5.4.130.0070.03512.07
5.4.120.0060.03612.02
5.4.110.0050.03812.01
5.4.100.0070.03512.01
5.4.90.0060.03712.01
5.4.80.0070.03812.02
5.4.70.0050.03712.01
5.4.60.0080.03412.01
5.4.50.0040.03812.01
5.4.40.0050.03712.00
5.4.30.0030.04012.00
5.4.20.0040.03812.00
5.4.10.0080.03312.00
5.4.00.0070.03711.49
5.3.290.0060.04112.80
5.3.280.0070.03812.71
5.3.270.0050.04212.72
5.3.260.0040.04412.72
5.3.250.0090.04412.72
5.3.240.0100.03412.72
5.3.230.0070.03912.71
5.3.220.0050.03912.68
5.3.210.0060.04012.68
5.3.200.0050.03912.68
5.3.190.0100.03512.68
5.3.180.0080.03612.68
5.3.170.0090.04212.67
5.3.160.0090.03512.67
5.3.150.0080.03612.67
5.3.140.0100.03512.66
5.3.130.0050.04012.66
5.3.120.0060.04112.66
5.3.110.0100.04412.66
5.3.100.0090.03412.13
5.3.90.0070.03812.11
5.3.80.0100.03412.10
5.3.70.0080.03612.10
5.3.60.0080.03512.08
5.3.50.0110.05112.04
5.3.40.0090.03912.04
5.3.30.0070.03511.99
5.3.20.0060.03611.77
5.3.10.0080.03411.73
5.3.00.0090.03411.73
5.2.170.0050.0379.23
5.2.160.0060.0299.23
5.2.150.0060.0309.23
5.2.140.0050.0319.23
5.2.130.0080.0279.18
5.2.120.0060.0299.19
5.2.110.0050.0319.20
5.2.100.0090.0259.19
5.2.90.0050.0309.18
5.2.80.0080.0289.18
5.2.70.0050.0349.18
5.2.60.0100.0269.14
5.2.50.0070.0289.11
5.2.40.0050.0299.08
5.2.30.0080.0349.06
5.2.20.0050.0369.04
5.2.10.0100.0358.95
5.2.00.0140.0338.81
5.1.60.0080.0328.09
5.1.50.0070.0338.09
5.1.40.0070.0348.07
5.1.30.0070.0358.42
5.1.20.0080.0288.45
5.1.10.0040.0298.17
5.1.00.0030.0288.17
5.0.50.0050.0206.65
5.0.40.0080.0166.51
5.0.30.0040.0336.33
5.0.20.0030.0226.29
5.0.10.0040.0216.27
5.0.00.0040.0326.26
4.4.90.0060.0134.78
4.4.80.0050.0134.75
4.4.70.0020.0164.75
4.4.60.0050.0154.76
4.4.50.0010.0184.77
4.4.40.0020.0264.71
4.4.30.0060.0124.76
4.4.20.0040.0154.85
4.4.10.0010.0184.85
4.4.00.0020.0264.75
4.3.110.0030.0164.67
4.3.100.0030.0154.66
4.3.90.0050.0134.64
4.3.80.0040.0234.59
4.3.70.0030.0144.63
4.3.60.0040.0154.63
4.3.50.0050.0164.63
4.3.40.0090.0254.54
4.3.30.0020.0203.30
4.3.20.0000.0213.28
4.3.10.0020.0173.24
4.3.00.0030.01725.98

preferences:
36.05 ms | 401 KiB | 5 Q