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; } public function nullify() { unset($this->bar); } } $quux = array(); for ($i=0; $i<10; $i++){ $quux[] = new Foo(); } foreach ($quux as $q) { if ($q->getBar()) { unset($q); } } 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.4.10.0100.01015.07
7.4.00.0030.01514.95
7.3.130.0180.00015.15
7.3.120.0070.00714.68
7.3.110.0100.00314.44
7.3.100.0120.00314.82
7.3.90.0080.00814.73
7.3.80.0000.01514.57
7.3.70.0130.00314.96
7.3.60.0030.00815.01
7.3.50.0040.01114.71
7.3.40.0040.00814.68
7.3.30.0060.00914.94
7.3.20.0100.00616.55
7.3.10.0070.00416.46
7.3.00.0070.00716.45
7.2.260.0100.01015.08
7.2.250.0060.01314.93
7.2.240.0090.00915.16
7.2.230.0030.00814.84
7.2.220.0040.01114.97
7.2.210.0110.00415.06
7.2.200.0070.01115.11
7.2.190.0070.01115.11
7.2.180.0070.00715.13
7.2.170.0040.01114.86
7.2.160.0030.01014.94
7.2.150.0110.00716.98
7.2.140.0090.00917.01
7.2.130.0130.00017.12
7.2.120.0090.00617.03
7.2.110.0030.01517.02
7.2.100.0040.01416.80
7.2.90.0110.00316.99
7.2.80.0000.01217.00
7.2.70.0030.01216.93
7.2.60.0060.01016.84
7.2.50.0120.00316.81
7.2.40.0000.01516.95
7.2.30.0090.00316.88
7.2.20.0080.00716.70
7.2.10.0060.00916.83
7.2.00.0050.00717.99
7.1.330.0000.01715.94
7.1.320.0030.01015.81
7.1.310.0070.00715.88
7.1.300.0080.00615.81
7.1.290.0030.00715.83
7.1.280.0040.00415.84
7.1.270.0040.01115.62
7.1.260.0040.00815.84
7.1.250.0000.01315.79
7.1.240.0070.01015.91
7.1.230.0100.00615.90
7.1.220.0030.01015.93
7.1.210.0040.00815.91
7.1.200.0090.00615.80
7.1.190.0000.01115.91
7.1.180.0090.00315.82
7.1.170.0070.00716.02
7.1.160.0080.00415.75
7.1.150.0150.00016.04
7.1.140.0030.00915.94
7.1.130.0070.00715.73
7.1.120.0030.00915.68
7.1.110.0030.01215.52
7.1.100.0030.01115.61
7.1.90.0070.00715.79
7.1.80.0080.00415.85
7.1.70.0040.00516.54
7.1.60.0080.01217.72
7.1.50.0030.01516.52
7.1.40.0040.01115.83
7.1.30.0070.00715.79
7.1.20.0070.01015.91
7.1.10.0070.00715.74
7.1.00.0020.04419.07
7.0.330.0070.00715.38
7.0.320.0090.00615.27
7.0.310.0080.00815.28
7.0.300.0140.00015.61
7.0.290.0030.00715.47
7.0.280.0070.00715.42
7.0.270.0000.01415.38
7.0.260.0090.00315.41
7.0.250.0090.00615.45
7.0.240.0100.00315.52
7.0.230.0080.00315.60
7.0.220.0070.01015.53
7.0.210.0030.01015.50
7.0.200.0110.00315.92
7.0.190.0070.01015.50
7.0.180.0040.01215.46
7.0.170.0120.00015.49
7.0.160.0070.00715.44
7.0.150.0110.00715.54
7.0.140.0070.04018.80
7.0.130.0030.01215.26
7.0.120.0070.01015.60
7.0.110.0070.00715.50
7.0.100.0060.00615.47
7.0.90.0040.01215.43
7.0.80.0070.00715.34
7.0.70.0060.00615.32
7.0.60.0070.02817.67
7.0.50.0030.03316.85
7.0.40.0070.02416.91
7.0.30.0180.02316.74
7.0.20.0130.03216.88
7.0.10.0120.03216.96
7.0.00.0050.04416.82
5.6.400.0040.01414.25
5.6.390.0060.00614.41
5.6.380.0030.01314.41
5.6.370.0060.00614.23
5.6.360.0070.01014.52
5.6.350.0080.00314.39
5.6.340.0040.01514.80
5.6.330.0120.00614.19
5.6.320.0060.00614.79
5.6.310.0040.00814.72
5.6.300.0100.00714.56
5.6.290.0060.00914.25
5.6.280.0070.03817.75
5.6.270.0060.01014.55
5.6.260.0070.00714.41
5.6.250.0070.00714.53
5.6.240.0080.00414.38
5.6.230.0000.01414.52
5.6.220.0030.00714.33
5.6.210.0110.03017.58
5.6.200.0020.04716.28
5.6.190.0080.04817.36
5.6.180.0050.04017.54
5.6.170.0180.04817.65
5.6.160.0120.03717.53
5.6.150.0070.04516.35
5.6.140.0030.03016.44
5.6.130.0070.03916.17
5.6.120.0130.03817.67
5.6.110.0070.03817.76
5.6.100.0070.03717.77
5.6.90.0030.05117.85
5.6.80.0100.03817.37
5.6.70.0220.04117.42
5.6.60.0080.00414.35
5.6.50.0030.01014.35
5.6.40.0030.01314.50
5.6.30.0060.00314.59
5.6.20.0070.00714.36
5.6.10.0000.01014.34
5.6.00.0060.00614.41
5.5.380.0090.00614.28
5.5.370.0070.00714.27
5.5.360.0160.00013.96
5.5.350.0080.04317.42
5.5.340.0050.02916.21
5.5.330.0070.03417.47
5.5.320.0140.03717.41
5.5.310.0230.04017.19
5.5.300.0090.03816.13
5.5.290.0070.02316.27
5.5.280.0080.02717.57
5.5.270.0030.02917.48
5.5.260.0120.03917.60
5.5.250.0020.03017.58
5.5.240.0030.02517.31
5.5.230.0100.00714.36
5.5.220.0040.01514.38
5.5.210.0070.00713.98
5.5.200.0030.00914.30
5.5.190.0030.01114.44
5.5.180.0090.00614.30
5.5.170.0040.00714.42
5.5.160.0070.01014.29
5.5.150.0090.00614.41
5.5.140.0030.01414.31
5.5.130.0030.00914.20
5.5.120.0100.00314.24
5.5.110.0100.00614.25
5.5.100.0070.01014.33
5.5.90.0080.00814.27
5.5.80.0120.00314.30
5.5.70.0110.00714.47
5.5.60.0030.01314.36
5.5.50.0000.01614.31
5.5.40.0100.00713.97
5.5.30.0070.01014.34
5.5.20.0030.01313.94
5.5.10.0070.00714.57
5.5.00.0110.00614.04
5.4.450.0170.02822.71
5.4.440.0260.02121.54
5.4.430.0150.02820.57
5.4.420.0190.02720.55
5.4.410.0170.02520.55
5.4.400.0170.02020.48
5.4.390.0180.02819.52
5.4.380.0080.02915.22
5.4.370.0130.02515.28
5.4.360.0100.02915.25
5.4.350.0090.03315.14
5.4.340.0130.02715.21
5.4.330.0050.00811.81
5.4.320.0090.02112.16
5.4.310.0060.02912.16
5.4.300.0060.02112.16
5.4.290.0070.02512.16
5.4.280.0080.01912.10
5.4.270.0050.02112.11
5.4.260.0040.02512.10
5.4.250.0080.01912.11
5.4.240.0050.02512.11
5.4.230.0110.02112.10
5.4.220.0060.02312.10
5.4.210.0080.01912.10
5.4.200.0060.02112.10
5.4.190.0100.02112.10
5.4.180.0080.02012.10
5.4.170.0080.02312.11
5.4.160.0060.02012.10
5.4.150.0080.02112.10
5.4.140.0060.02111.94
5.4.130.0080.02311.94
5.4.120.0080.01911.92
5.4.110.0100.02311.91
5.4.100.0040.02611.91
5.4.90.0070.02311.92
5.4.80.0110.02011.91
5.4.70.0050.02111.91
5.4.60.0060.01811.91
5.4.50.0050.02111.91
5.4.40.0080.01711.91
5.4.30.0060.02011.91
5.4.20.0050.01911.91
5.4.10.0060.02311.90
5.4.00.0020.02611.65
5.3.290.0060.02212.31
5.3.280.0060.02112.26
5.3.270.0080.02112.27
5.3.260.0050.02512.27
5.3.250.0050.02812.27
5.3.240.0080.02212.27
5.3.230.0060.02112.26
5.3.220.0090.02012.25
5.3.210.0040.02512.25
5.3.200.0070.02012.25
5.3.190.0050.02312.25
5.3.180.0060.02112.24
5.3.170.0070.02712.24
5.3.160.0060.02112.24
5.3.150.0040.02312.24
5.3.140.0100.01812.24
5.3.130.0050.02512.24
5.3.120.0100.02112.23
5.3.110.0050.02212.23
5.3.100.0070.02011.97
5.3.90.0070.02011.96
5.3.80.0060.02211.96
5.3.70.0080.02111.96
5.3.60.0070.01911.95
5.3.50.0020.02411.93
5.3.40.0060.02011.93
5.3.30.0070.01911.90
5.3.20.0080.01811.79
5.3.10.0030.02211.77
5.3.00.0090.02011.77
5.2.170.0060.0299.23
5.2.160.0090.0269.23
5.2.150.0060.0429.23
5.2.140.0050.0329.23
5.2.130.0050.0319.19
5.2.120.0030.0319.19
5.2.110.0060.0289.19
5.2.100.0070.0319.19
5.2.90.0040.0319.19
5.2.80.0040.0319.18
5.2.70.0100.0329.18
5.2.60.0050.0309.13
5.2.50.0090.0319.10
5.2.40.0030.0389.08
5.2.30.0050.0319.06
5.2.20.0040.0299.04
5.2.10.0080.0288.95
5.2.00.0100.0318.81
5.1.60.0050.0338.09
5.1.50.0060.0268.09
5.1.40.0050.0298.07
5.1.30.0040.0288.42
5.1.20.0080.0258.45
5.1.10.0040.0298.17
5.1.00.0070.0338.16
5.0.50.0050.0206.66
5.0.40.0080.0166.51
5.0.30.0060.0306.33
5.0.20.0090.0166.29
5.0.10.0050.0196.27
5.0.00.0050.0306.26
4.4.90.0030.0164.78
4.4.80.0030.0154.75
4.4.70.0030.0154.75
4.4.60.0020.0164.76
4.4.50.0030.0144.77
4.4.40.0010.0274.71
4.4.30.0040.0144.76
4.4.20.0040.0144.84
4.4.10.0030.0154.85
4.4.00.0010.0264.76
4.3.110.0040.0144.67
4.3.100.0020.0154.66
4.3.90.0020.0154.63
4.3.80.0030.0244.58
4.3.70.0030.0144.63
4.3.60.0040.0174.63
4.3.50.0030.0144.63
4.3.40.0010.0244.54
4.3.30.0030.0143.30
4.3.20.0020.0153.28
4.3.10.0000.0173.24
4.3.00.0070.01726.63

preferences:
32.43 ms | 401 KiB | 5 Q