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); } } echo '<pre>'; print_r($quux); echo '</pre>'; $qwax = array(); foreach ($quux as $q) { if ($q->getBar()) { $qwax[] = $q; } } echo '<pre>'; print_r($qwax); echo '</pre>';

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.0090.00916.66
7.4.00.0100.00716.36
7.3.130.0070.01316.44
7.3.120.0040.01516.34
7.3.110.0100.00316.17
7.3.100.0150.00016.38
7.3.90.0140.00016.42
7.3.80.0060.00316.52
7.3.70.0050.00516.38
7.3.60.0100.00716.36
7.3.50.0060.00316.21
7.3.40.0070.01016.43
7.3.30.0000.01416.49
7.3.20.0040.01218.08
7.3.10.0070.01018.24
7.3.00.0090.00618.16
7.2.260.0070.00716.62
7.2.250.0070.01316.66
7.2.240.0090.00616.69
7.2.230.0030.01416.70
7.2.220.0030.01216.72
7.2.210.0070.00716.71
7.2.200.0040.01116.56
7.2.190.0000.01416.61
7.2.180.0030.01016.69
7.2.170.0030.01316.78
7.2.160.0040.00816.57
7.2.150.0130.00318.44
7.2.140.0030.01218.41
7.2.130.0030.01018.59
7.2.120.0070.01018.47
7.2.110.0090.00318.54
7.2.100.0070.00718.47
7.2.90.0080.00818.62
7.2.80.0070.01018.30
7.2.70.0030.00718.28
7.2.60.0090.00318.25
7.2.50.0030.00918.50
7.2.40.0060.01018.46
7.2.30.0130.00318.41
7.2.20.0130.00318.45
7.2.10.0040.00718.35
7.2.00.0030.01018.96
7.1.330.0080.01117.45
7.1.320.0050.00517.38
7.1.310.0100.00317.50
7.1.300.0030.01017.35
7.1.290.0060.00617.38
7.1.280.0000.01017.29
7.1.270.0000.00917.57
7.1.260.0030.00917.23
7.1.250.0040.00817.36
7.1.240.0100.00717.31
7.1.230.0060.00917.34
7.1.220.0120.00417.25
7.1.210.0000.01417.34
7.1.200.0100.00717.31
7.1.190.0040.01117.43
7.1.180.0060.00617.30
7.1.170.0070.00717.22
7.1.160.0100.00717.16
7.1.150.0030.01017.38
7.1.140.0070.01017.32
7.1.130.0040.00717.43
7.1.120.0040.01117.21
7.1.110.0120.00317.32
7.1.100.0100.00317.36
7.1.90.0050.00517.26
7.1.80.0100.00717.35
7.1.70.0060.00517.13
7.1.60.0090.00818.54
7.1.50.0040.01117.15
7.1.40.0040.01117.39
7.1.30.0070.00317.47
7.1.20.0070.00717.34
7.1.10.0080.00817.55
7.1.00.0070.04019.75
7.0.330.0060.01516.95
7.0.320.0000.01616.98
7.0.310.0100.00617.04
7.0.300.0100.00316.96
7.0.290.0080.00816.98
7.0.280.0110.00716.91
7.0.270.0080.00417.00
7.0.260.0080.00816.95
7.0.250.0030.01017.00
7.0.240.0060.00617.20
7.0.230.0100.01017.14
7.0.220.0090.00917.16
7.0.210.0070.00416.85
7.0.200.0040.00616.86
7.0.190.0110.00717.05
7.0.180.0000.01517.16
7.0.170.0100.00316.96
7.0.160.0090.00617.01
7.0.150.0060.00616.90
7.0.140.0030.04119.64
7.0.130.0100.00617.16
7.0.120.0040.00817.05
7.0.110.0100.00717.14
7.0.100.0030.01616.73
7.0.90.0040.01116.96
7.0.80.0030.01016.98
7.0.70.0000.01516.99
7.0.60.0100.02018.47
7.0.50.0100.03117.50
7.0.40.0030.02717.61
7.0.30.0110.02717.60
7.0.20.0150.04217.61
7.0.10.0190.04417.54
7.0.00.0040.04917.61
5.6.400.0030.01315.98
5.6.390.0090.00916.13
5.6.380.0070.00716.06
5.6.370.0000.01116.01
5.6.360.0040.01116.20
5.6.350.0070.00315.76
5.6.340.0080.00816.04
5.6.330.0060.00616.07
5.6.320.0070.00315.70
5.6.310.0040.01116.10
5.6.300.0070.00415.95
5.6.290.0060.01016.04
5.6.280.0050.04118.64
5.6.270.0060.01316.09
5.6.260.0150.00815.55
5.6.250.0090.00915.84
5.6.240.0040.01116.18
5.6.230.0070.00716.00
5.6.220.0110.00016.18
5.6.210.0130.04118.42
5.6.200.0100.03717.24
5.6.190.0080.04818.24
5.6.180.0060.03118.12
5.6.170.0200.03518.43
5.6.160.0030.02818.24
5.6.150.0070.03117.14
5.6.140.0110.03117.14
5.6.130.0050.04117.00
5.6.120.0100.04518.49
5.6.110.0060.02418.40
5.6.100.0080.04618.45
5.6.90.0100.04618.56
5.6.80.0120.02818.20
5.6.70.0180.04218.14
5.6.60.0070.00715.89
5.6.50.0090.00615.98
5.6.40.0060.01316.18
5.6.30.0070.01315.82
5.6.20.0000.01315.86
5.6.10.0060.01216.02
5.6.00.0060.01215.93
5.5.380.0100.01015.56
5.5.370.0100.01015.79
5.5.360.0080.00415.82
5.5.350.0050.05017.90
5.5.340.0060.02316.95
5.5.330.0120.04518.15
5.5.320.0220.02218.07
5.5.310.0180.04318.12
5.5.300.0120.03816.94
5.5.290.0090.02216.96
5.5.280.0100.02818.29
5.5.270.0020.04018.19
5.5.260.0070.04718.37
5.5.250.0090.04018.22
5.5.240.0120.04017.88
5.5.230.0120.00415.84
5.5.220.0030.01315.85
5.5.210.0110.00415.87
5.5.200.0150.01115.66
5.5.190.0080.00415.63
5.5.180.0000.01815.64
5.5.170.0120.00615.89
5.5.160.0060.01115.76
5.5.150.0100.00715.93
5.5.140.0090.00615.73
5.5.130.0080.00815.56
5.5.120.0090.00616.00
5.5.110.0050.01015.66
5.5.100.0070.00715.60
5.5.90.0090.00915.88
5.5.80.0040.01615.73
5.5.70.0080.01115.76
5.5.60.0040.01215.73
5.5.50.0070.01015.57
5.5.40.0090.00915.88
5.5.30.0080.01215.84
5.5.20.0110.00815.78
5.5.10.0110.00415.82
5.5.00.0070.01415.76
5.4.450.0280.02823.22
5.4.440.0220.02521.97
5.4.430.0110.02821.04
5.4.420.0390.02015.87
5.4.410.0250.02121.04
5.4.400.0120.02920.98
5.4.390.0320.02219.79
5.4.380.0070.03015.69
5.4.370.0110.02815.49
5.4.360.0140.02815.68
5.4.350.0100.03215.64
5.4.340.0130.02815.65
5.4.330.0040.01212.69
5.4.320.0120.01812.54
5.4.310.0060.02412.52
5.4.300.0080.02612.51
5.4.290.0090.01912.62
5.4.280.0070.02112.55
5.4.270.0080.02012.53
5.4.260.0060.02412.46
5.4.250.0060.02412.46
5.4.240.0040.02612.40
5.4.230.0060.02412.41
5.4.220.0070.01712.57
5.4.210.0060.02212.56
5.4.200.0080.02112.60
5.4.190.0120.01712.51
5.4.180.0060.02012.51
5.4.170.0070.02512.46
5.4.160.0040.02312.48
5.4.150.0060.02512.53
5.4.140.0060.02512.32
5.4.130.0100.02412.34
5.4.120.0090.02012.38
5.4.110.0080.02012.37
5.4.100.0050.02512.33
5.4.90.0070.02412.26
5.4.80.0060.02412.28
5.4.70.0060.02412.33
5.4.60.0090.01912.27
5.4.50.0090.02112.31
5.4.40.0110.01912.30
5.4.30.0060.02112.36
5.4.20.0080.02012.22
5.4.10.0060.02612.21
5.4.00.0080.02111.96
5.3.290.0120.02512.98
5.3.280.0080.02512.92
5.3.270.0130.02312.91
5.3.260.0120.02612.91
5.3.250.0060.02812.92
5.3.240.0120.02612.92
5.3.230.0110.02412.88
5.3.220.0110.02212.83
5.3.210.0100.02512.83
5.3.200.0100.02412.95
5.3.190.0070.02312.86
5.3.180.0080.02612.92
5.3.170.0100.02113.01
5.3.160.0110.02112.93
5.3.150.0120.02112.92
5.3.140.0090.02312.88
5.3.130.0080.02712.88
5.3.120.0090.02412.94
5.3.110.0070.03012.88
5.3.100.0080.01912.61
5.3.90.0040.02512.60
5.3.80.0060.02312.47
5.3.70.0080.02112.53
5.3.60.0080.02112.58
5.3.50.0040.02712.50
5.3.40.0040.02512.51
5.3.30.0070.02312.64
5.3.20.0060.02112.37
5.3.10.0060.02212.29
5.3.00.0060.02512.24
5.2.170.0060.0339.23
5.2.160.0060.0299.23
5.2.150.0080.0319.23
5.2.140.0100.0269.23
5.2.130.0020.0339.19
5.2.120.0080.0309.19
5.2.110.0070.0339.20
5.2.100.0110.0249.18
5.2.90.0070.0279.19
5.2.80.0050.0349.19
5.2.70.0060.0309.19
5.2.60.0020.0339.14
5.2.50.0080.0289.11
5.2.40.0060.0289.08
5.2.30.0090.0349.05
5.2.20.0070.0359.04
5.2.10.0070.0348.95
5.2.00.0060.0288.82
5.1.60.0040.0318.09
5.1.50.0070.0228.09
5.1.40.0060.0238.07
5.1.30.0060.0278.42
5.1.20.0040.0278.45
5.1.10.0040.0328.16
5.1.00.0070.0258.17
5.0.50.0040.0236.66
5.0.40.0050.0196.51
5.0.30.0050.0356.33
5.0.20.0040.0206.29
5.0.10.0040.0276.27
5.0.00.0080.0286.26
4.4.90.0050.0174.78
4.4.80.0030.0144.75
4.4.70.0020.0224.75
4.4.60.0040.0164.75
4.4.50.0030.0194.77
4.4.40.0030.0284.71
4.4.30.0030.0214.76
4.4.20.0040.0194.85
4.4.10.0030.0154.85
4.4.00.0020.0254.76
4.3.110.0020.0164.67
4.3.100.0010.0164.67
4.3.90.0030.0154.63
4.3.80.0010.0254.59
4.3.70.0010.0214.63
4.3.60.0040.0174.62
4.3.50.0040.0184.63
4.3.40.0020.0284.54
4.3.30.0030.0153.30
4.3.20.0020.0233.28
4.3.10.0000.0293.23
4.3.00.0100.01326.63

preferences:
40.62 ms | 400 KiB | 5 Q