3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * My results: * * Average time to process 10,000 items, 100 runs * * Array:: 0.0034920692443848 * Obj: 0.026956255435944 */ /** * Class foo */ class Foo { /** * @var */ protected $bar; /** * Builds it. * * @param mixed $bar * Something bar */ public function __construct($bar) { $this->bar = $bar; } /** * Something. * * @return mixed * Something */ public function getBar() { return $this->bar; } } $foo['bar'] = 'baz'; $baz = new Foo('baz'); $cycles = 10000; $array = $obj = array(); for ($j = 0; $j < 100; $j++) { $start = microtime(TRUE); for ($i = 0; $i < $cycles; $i++) { $b = $foo['bar']; } $array[] = microtime(TRUE) - $start; $start = microtime(TRUE); for ($i = 0; $i < $cycles; $i++) { $b = $baz->getBar(); } $obj[] = microtime(TRUE) - $start; } echo array_sum($array) / count($array); echo array_sum($obj) / count($obj);

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.0000.07116.51
7.3.00.0030.06716.63
7.2.130.0030.06917.04
7.2.120.0000.09316.99
7.2.110.0030.07116.88
7.2.100.0060.06817.00
7.2.90.0060.07016.93
7.2.80.0030.07216.91
7.2.70.0070.06916.90
7.2.60.0060.06416.74
7.2.50.0030.07116.84
7.2.40.0000.07717.05
7.2.30.0070.07316.82
7.2.20.0030.07916.92
7.2.10.0100.06417.00
7.2.00.0030.07218.16
7.1.250.0000.17715.68
7.1.70.0030.06817.38
7.1.60.0070.12919.46
7.1.50.0030.10917.10
7.1.00.0030.15722.45
7.0.200.0030.07916.57
7.0.140.0000.19022.09
7.0.100.0230.14020.18
7.0.90.0270.13319.92
7.0.80.0270.14719.90
7.0.70.0170.16319.99
7.0.60.0100.12719.94
7.0.50.0030.14320.22
7.0.40.0100.11720.00
7.0.30.0070.14020.19
7.0.20.0070.14720.14
7.0.10.0070.11020.03
7.0.00.0070.14020.11
5.6.280.0070.24320.93
5.6.250.0130.21320.73
5.6.240.0230.23720.71
5.6.230.0170.23720.73
5.6.220.0070.24320.63
5.6.210.0130.21720.66
5.6.200.0070.22721.09
5.6.190.0030.20721.06
5.6.180.0270.23321.10
5.6.170.0130.20321.15
5.6.160.0100.18721.13
5.6.150.0100.18321.14
5.6.140.0070.24321.04
5.6.130.0100.22021.05
5.6.120.0130.22721.08
5.6.110.0130.24021.01
5.6.100.0100.21720.99
5.6.90.0070.22721.08
5.6.80.0130.22020.40
5.6.70.0070.23020.41
5.6.60.0070.21020.32
5.6.50.0170.21320.46
5.6.40.0100.18720.42
5.6.30.0070.20320.43
5.6.20.0170.19020.41
5.6.10.0200.20320.47
5.6.00.0100.22720.41
5.5.380.0030.23720.58
5.5.370.0130.23720.36
5.5.360.0030.21320.52
5.5.350.0100.20320.38
5.5.340.0170.22720.87
5.5.330.0030.22320.93
5.5.320.0130.19320.77
5.5.310.0070.21020.88
5.5.300.0000.22320.94
5.5.290.0100.23020.89
5.5.280.0130.17720.89
5.5.270.0030.21720.93
5.5.260.0100.21020.84
5.5.250.0100.25020.76
5.5.240.0130.22720.30
5.5.230.0130.24020.22
5.5.220.0130.23020.28
5.5.210.0030.23720.29
5.5.200.0170.22720.23
5.5.190.0030.25320.16
5.5.180.0030.21020.13
5.5.160.0100.22020.24
5.5.150.0070.23020.29
5.5.140.0030.18020.00
5.5.130.0100.21320.00
5.5.120.0070.22720.20
5.5.110.0030.20020.22
5.5.100.0000.22020.11
5.5.90.0070.21720.12
5.5.80.0130.21320.05
5.5.70.0030.18020.05
5.5.60.0130.22720.16
5.5.50.0030.25020.07
5.5.40.0030.23319.97
5.5.30.0070.23719.96
5.5.20.0030.21020.07
5.5.10.0070.18320.02
5.5.00.0100.19320.11
5.4.450.0100.19719.39
5.4.440.0130.21019.27
5.4.430.0230.21319.27
5.4.420.0030.22319.16
5.4.410.0200.20719.36
5.4.400.0200.20019.13
5.4.390.0200.22019.03
5.4.380.0130.22019.03
5.4.370.0030.25019.05
5.4.360.0070.21719.05
5.4.350.0130.24719.03
5.4.340.0070.22319.18
5.4.320.0130.22018.87
5.4.310.0070.22018.95
5.4.300.0030.24018.90
5.4.290.0130.17719.02
5.4.280.0030.22319.07
5.4.270.0000.25318.94
5.4.260.0000.25319.12
5.4.250.0100.25019.23
5.4.240.0100.21319.11
5.4.230.0030.23319.17
5.4.220.0100.24718.87
5.4.210.0030.24719.16
5.4.200.0200.21319.04
5.4.190.0170.23318.84
5.4.180.0070.21319.02
5.4.170.0030.18719.07
5.4.160.0000.18319.19
5.4.150.0030.22719.10
5.4.140.0000.23316.43
5.4.130.0070.18316.25
5.4.120.0100.21016.41
5.4.110.0030.17016.41
5.4.100.0070.22716.50
5.4.90.0070.15716.37
5.4.80.0000.17316.33
5.4.70.0000.16316.29
5.4.60.0070.16016.44
5.4.50.0000.22316.42
5.4.40.0130.22716.49
5.4.30.0130.21016.27
5.4.20.0170.23016.49
5.4.10.0000.20016.32
5.4.00.0100.23015.79
5.3.290.0100.30715.73
5.3.280.0400.29715.73
5.3.270.0100.27315.73
5.3.260.0030.30015.73
5.3.250.0100.26015.73
5.3.240.0070.34015.73
5.3.230.0070.27015.73
5.3.220.0070.30015.73
5.3.210.0070.29315.73
5.3.200.0070.26015.73
5.3.190.0070.25315.73
5.3.180.0030.25315.73
5.3.170.0000.25315.73
5.3.160.0070.31315.73
5.3.150.0730.23315.73
5.3.140.0070.26315.73
5.3.130.0100.31715.73
5.3.120.0100.28315.73
5.3.110.0070.33715.73
5.3.100.0000.28015.73
5.3.90.0000.32715.73
5.3.80.0070.30715.73
5.3.70.0070.32315.73
5.3.60.0100.30315.73
5.3.50.0130.31015.73
5.3.40.0030.30315.73
5.3.30.0100.31715.73
5.3.20.0000.33015.73
5.3.10.0070.31015.73
5.3.00.0070.30315.73
5.2.170.0070.34715.73
5.2.160.0000.36015.73
5.2.150.0130.34015.73
5.2.140.0070.33715.73
5.2.130.0030.33015.73
5.2.120.0070.32315.73
5.2.110.0030.37315.73
5.2.100.0000.37015.73
5.2.90.0000.35015.73
5.2.80.0070.38015.73
5.2.70.0070.36015.73
5.2.60.0070.35015.73
5.2.50.0070.38015.73
5.2.40.0070.33715.73
5.2.30.0070.36715.73
5.2.20.0000.37015.73
5.2.10.0000.31715.73
5.2.00.0130.36715.73
5.1.60.0030.34715.73
5.1.50.0070.35715.73
5.1.40.0030.37315.73
5.1.30.0100.35315.73
5.1.20.0100.34715.73
5.1.10.0030.38315.73
5.1.00.0070.36015.73
5.0.50.0030.57315.73
5.0.40.0000.55015.73
5.0.30.0000.58015.73
5.0.20.0000.55015.73
5.0.10.0030.54315.73
5.0.00.0070.58315.73
4.4.90.0100.02015.73
4.4.80.0000.04015.73
4.4.70.0070.02715.73
4.4.60.0030.03315.73
4.4.50.0070.03015.73
4.4.40.0000.05015.73
4.4.30.0070.03015.73
4.4.20.0030.03315.73
4.4.10.0030.02315.73
4.4.00.0030.04015.73
4.3.110.0000.03015.73
4.3.100.0000.03315.73
4.3.90.0000.03715.73
4.3.80.0030.05315.73
4.3.70.0000.03715.73
4.3.60.0030.03315.73
4.3.50.0100.02715.73
4.3.40.0070.04715.73
4.3.30.0000.03715.73
4.3.20.0100.03015.73
4.3.10.0030.03715.73
4.3.00.0000.03715.73

preferences:
30.03 ms | 401 KiB | 5 Q