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 $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.3.10.0060.00616.53
7.3.00.0070.00716.69
7.2.130.0080.00416.93
7.2.120.0060.00616.93
7.2.110.0080.00816.99
7.2.100.0040.01116.75
7.2.90.0070.00717.14
7.2.80.0030.00717.09
7.2.70.0040.01116.79
7.2.60.0000.01016.72
7.2.50.0070.00616.86
7.2.40.0030.00916.85
7.2.30.0070.01117.02
7.2.20.0090.00317.02
7.2.10.0110.00317.09
7.2.00.0040.01118.09
7.1.250.0070.00715.87
7.1.70.0000.00917.10
7.1.60.0080.00419.70
7.1.50.0040.01116.77
7.1.00.0000.08022.48
7.0.200.0070.00316.49
7.0.140.0000.07322.09
7.0.60.0130.06019.86
7.0.50.0100.07717.84
7.0.40.0130.03720.27
7.0.30.0230.07020.23
7.0.20.0300.08020.15
7.0.10.0270.06020.08
7.0.00.0100.03320.24
5.6.280.0100.06720.87
5.6.210.0070.08020.50
5.6.200.0070.08318.22
5.6.190.0130.08320.42
5.6.180.0030.04020.33
5.6.170.0170.04020.51
5.6.160.0100.05720.46
5.6.150.0030.04318.18
5.6.140.0170.07018.14
5.6.130.0000.04318.18
5.6.120.0030.04021.00
5.6.110.0030.05321.09
5.6.100.0170.06320.96
5.6.90.0070.04721.02
5.6.80.0100.06320.54
5.6.70.0270.05720.35
5.5.350.0000.08320.44
5.5.340.0170.07317.93
5.5.330.0070.08320.29
5.5.320.0130.05020.51
5.5.310.0330.06720.35
5.5.300.0070.06017.94
5.5.290.0070.04017.93
5.5.280.0030.09320.90
5.5.270.0070.07720.80
5.5.260.0030.05320.74
5.5.250.0100.07720.46
5.5.240.0100.07020.37
5.4.450.0170.04033.62
5.4.440.0530.03731.27
5.4.430.0500.03329.32
5.4.420.0300.05029.30
5.4.410.0170.04329.29
5.4.400.0330.03729.25
5.4.390.0400.04326.93
5.4.380.0230.04318.54
5.4.370.0130.05318.68
5.4.360.0100.05318.68
5.4.350.0200.06018.59
5.4.340.0070.06018.61
5.4.320.0120.03712.51
5.4.310.0110.03912.50
5.4.300.0080.03612.51
5.4.290.0070.04412.50
5.4.280.0080.04312.39
5.4.270.0080.04012.40
5.4.260.0090.03612.40
5.4.250.0080.03712.40
5.4.240.0100.04012.40
5.4.230.0070.03812.39
5.4.220.0060.03612.39
5.4.210.0040.03712.39
5.4.200.0090.03512.39
5.4.190.0090.03312.39
5.4.180.0090.03412.39
5.4.170.0070.04412.40
5.4.160.0060.04312.39
5.4.150.0060.03712.39
5.4.140.0090.04012.07
5.4.130.0120.04212.06
5.4.120.0090.03912.02
5.4.110.0050.03712.02
5.4.100.0050.03812.02
5.4.90.0100.03312.02
5.4.80.0100.03312.01
5.4.70.0070.03412.01
5.4.60.0040.03812.02
5.4.50.0070.04212.01
5.4.40.0100.03512.00
5.4.30.0030.04812.00
5.4.20.0080.03412.00
5.4.10.0110.02912.00
5.4.00.0070.03611.49
5.3.290.0080.03712.80
5.3.280.0070.03712.71
5.3.270.0070.05112.72
5.3.260.0140.03612.72
5.3.250.0050.04412.72
5.3.240.0050.03712.71
5.3.230.0070.03812.71
5.3.220.0100.03512.68
5.3.210.0080.03612.68
5.3.200.0070.03612.68
5.3.190.0070.03712.68
5.3.180.0080.03512.67
5.3.170.0090.03412.66
5.3.160.0060.03812.67
5.3.150.0080.04212.68
5.3.140.0090.03712.66
5.3.130.0090.04312.66
5.3.120.0080.03912.66
5.3.110.0090.03612.66
5.3.100.0090.03912.13
5.3.90.0090.03412.11
5.3.80.0120.03112.10
5.3.70.0040.03812.10
5.3.60.0080.03512.08
5.3.50.0090.03412.04
5.3.40.0080.03912.03
5.3.30.0080.03211.99
5.3.20.0080.03811.77
5.3.10.0040.03911.73
5.3.00.0070.03611.73
5.2.170.0050.0389.23
5.2.160.0060.0289.23
5.2.150.0060.0309.23
5.2.140.0050.0329.22
5.2.130.0010.0339.19
5.2.120.0020.0329.18
5.2.110.0050.0299.19
5.2.100.0070.0289.18
5.2.90.0060.0289.19
5.2.80.0090.0309.18
5.2.70.0040.0319.18
5.2.60.0060.0309.13
5.2.50.0080.0279.11
5.2.40.0050.0309.07
5.2.30.0100.0309.06
5.2.20.0070.0289.04
5.2.10.0080.0278.95
5.2.00.0070.0298.81
5.1.60.0070.0298.09
5.1.50.0030.0278.09
5.1.40.0060.0258.07
5.1.30.0040.0278.42
5.1.20.0050.0338.44
5.1.10.0080.0248.17
5.1.00.0100.0258.16
5.0.50.0050.0266.65
5.0.40.0040.0236.51
5.0.30.0070.0296.33
5.0.20.0030.0216.29
5.0.10.0060.0196.27
5.0.00.0030.0376.26
4.4.90.0040.0154.78
4.4.80.0040.0144.75
4.4.70.0020.0164.75
4.4.60.0020.0164.76
4.4.50.0020.0164.77
4.4.40.0040.0244.71
4.4.30.0030.0154.76
4.4.20.0000.0184.84
4.4.10.0030.0154.85
4.4.00.0030.0244.76
4.3.110.0030.0164.66
4.3.100.0010.0174.67
4.3.90.0040.0134.63
4.3.80.0020.0244.59
4.3.70.0020.0154.63
4.3.60.0020.0154.63
4.3.50.0030.0154.63
4.3.40.0030.0294.54
4.3.30.0020.0223.30
4.3.20.0020.0163.28
4.3.10.0030.0143.23
4.3.00.0100.01026.62

preferences:
25.62 ms | 401 KiB | 5 Q