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.4.00.0130.00715.07
7.3.120.0050.01314.55
7.3.110.0060.01314.96
7.3.100.0000.01014.95
7.3.90.0070.00714.65
7.3.80.0100.00314.92
7.3.70.0040.01115.05
7.3.60.0070.00714.62
7.3.50.0030.01014.77
7.3.40.0030.00614.90
7.3.30.0060.00914.54
7.3.20.0060.01216.67
7.3.10.0060.00816.41
7.3.00.0080.00416.59
7.2.250.0070.01115.21
7.2.240.0000.02015.29
7.2.230.0030.00915.31
7.2.220.0070.00715.04
7.2.210.0080.00615.23
7.2.200.0060.00915.01
7.2.190.0040.00715.01
7.2.180.0100.00315.09
7.2.170.0070.00714.84
7.2.130.0070.00616.87
7.2.120.0060.00316.96
7.2.110.0080.00717.00
7.2.100.0100.00116.89
7.2.90.0050.00916.85
7.2.80.0050.01117.04
7.2.70.0050.00817.00
7.2.60.0060.00317.04
7.2.50.0030.01116.96
7.2.40.0070.00517.12
7.2.30.0100.00417.03
7.2.20.0070.00916.84
7.2.10.0020.01016.90
7.2.00.0050.00717.77
7.1.330.0070.00715.86
7.1.320.0040.00715.99
7.1.310.0000.01415.73
7.1.300.0030.00615.85
7.1.290.0100.00715.80
7.1.280.0040.01415.84
7.1.270.0070.00415.77
7.1.260.0100.00315.85
7.1.250.0040.00815.82
7.1.70.0070.00716.93
7.1.60.0040.01819.70
7.1.50.0060.01516.89
7.1.00.0070.07322.45
7.0.200.0000.00816.47
7.0.140.0030.07721.92
7.0.60.0270.04720.05
7.0.50.0070.05017.88
7.0.40.0070.04020.35
7.0.30.0200.06720.26
7.0.20.0200.04020.26
7.0.10.0200.05020.20
7.0.00.0100.08320.09
5.6.280.0070.07020.83
5.6.210.0130.05720.67
5.6.200.0000.05318.18
5.6.190.0030.04720.42
5.6.180.0100.06720.68
5.6.170.0300.05720.60
5.6.160.0030.06720.47
5.6.150.0070.03718.27
5.6.140.0100.04718.28
5.6.130.0100.08718.20
5.6.120.0030.07020.91
5.6.110.0130.07321.03
5.6.100.0030.04320.89
5.6.90.0070.07320.88
5.6.80.0030.05720.40
5.5.350.0070.03720.41
5.5.340.0070.06717.99
5.5.330.0100.05020.13
5.5.320.0270.07320.37
5.5.310.0370.07720.41
5.5.300.0030.04718.08
5.5.290.0030.05717.95
5.5.280.0130.06320.77
5.5.270.0030.08720.80
5.5.260.0030.08720.86
5.5.250.0170.04720.71
5.5.240.0230.04720.03
5.4.450.0630.02733.62
5.4.440.0230.05031.27
5.4.430.0370.04329.32
5.4.420.0570.04729.30
5.4.410.0400.04029.29
5.4.400.0370.03729.14
5.4.390.0200.05026.75
5.4.380.0130.05018.68
5.4.370.0830.04318.72
5.4.360.0630.05318.45
5.4.350.0630.06318.72
5.4.340.0700.04718.62
5.4.320.0040.03812.50
5.4.310.0060.03912.50
5.4.300.0070.03512.50
5.4.290.0040.03812.50
5.4.280.0060.03412.40
5.4.270.0110.03112.40
5.4.260.0100.03612.40
5.4.250.0060.03712.40
5.4.240.0060.03512.40
5.4.230.0070.03612.39
5.4.220.0040.03712.39
5.4.210.0060.04212.39
5.4.200.0050.04212.39
5.4.190.0050.03912.38
5.4.180.0040.03612.39
5.4.170.0050.03512.40
5.4.160.0060.04112.39
5.4.150.0060.03712.39
5.4.140.0050.03812.08
5.4.130.0080.03312.06
5.4.120.0060.04012.02
5.4.110.0070.03512.02
5.4.100.0080.03412.02
5.4.90.0070.03812.01
5.4.80.0060.03812.02
5.4.70.0030.03812.01
5.4.60.0050.03612.01
5.4.50.0090.03812.01
5.4.40.0060.03712.00
5.4.30.0090.03712.00
5.4.20.0050.03712.00
5.4.10.0070.03312.00
5.4.00.0070.03611.49
5.3.290.0070.03812.80
5.3.280.0040.04012.71
5.3.270.0100.03912.72
5.3.260.0050.03912.72
5.3.250.0070.03712.72
5.3.240.0070.03712.72
5.3.230.0130.03312.71
5.3.220.0060.03812.68
5.3.210.0060.03912.68
5.3.200.0060.03712.68
5.3.190.0070.03612.68
5.3.180.0050.03812.67
5.3.170.0070.03512.67
5.3.160.0080.03512.67
5.3.150.0080.03512.68
5.3.140.0100.03212.66
5.3.130.0080.03712.66
5.3.120.0050.04012.66
5.3.110.0060.04012.66
5.3.100.0070.03712.13
5.3.90.0060.03712.11
5.3.80.0050.03712.10
5.3.70.0080.03412.10
5.3.60.0050.03712.08
5.3.50.0070.03512.04
5.3.40.0040.03912.03
5.3.30.0070.03411.99
5.3.20.0060.03511.77
5.3.10.0070.03411.74
5.3.00.0050.03911.73
5.2.170.0010.0359.23
5.2.160.0070.0289.23
5.2.150.0060.0299.23
5.2.140.0090.0269.22
5.2.130.0080.0269.19
5.2.120.0020.0319.18
5.2.110.0020.0329.19
5.2.100.0030.0309.18
5.2.90.0070.0269.19
5.2.80.0100.0249.18
5.2.70.0040.0309.18
5.2.60.0040.0339.14
5.2.50.0050.0309.10
5.2.40.0040.0309.08
5.2.30.0050.0369.05
5.2.20.0040.0309.04
5.2.10.0030.0318.95
5.2.00.0090.0268.81
5.1.60.0060.0248.09
5.1.50.0080.0218.09
5.1.40.0050.0248.07
5.1.30.0040.0268.42
5.1.20.0080.0278.45
5.1.10.0070.0268.16
5.1.00.0010.0298.17
5.0.50.0030.0226.66
5.0.40.0050.0186.51
5.0.30.0030.0326.33
5.0.20.0040.0196.29
5.0.10.0030.0216.27
5.0.00.0030.0316.26
4.4.90.0010.0174.77
4.4.80.0010.0164.75
4.4.70.0030.0154.76
4.4.60.0020.0164.75
4.4.50.0040.0154.77
4.4.40.0010.0264.71
4.4.30.0030.0154.75
4.4.20.0040.0144.84
4.4.10.0040.0144.85
4.4.00.0050.0234.76
4.3.110.0020.0164.67
4.3.100.0040.0134.66
4.3.90.0010.0164.64
4.3.80.0030.0244.59
4.3.70.0010.0164.63
4.3.60.0020.0154.63
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0010.0173.30
4.3.20.0040.0143.28
4.3.10.0050.0133.24
4.3.00.0130.01025.66

preferences:
34.45 ms | 401 KiB | 5 Q