3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { public function get() {} } class Foo { protected $model; public function __construct() { $this->model = new Model; } public function doSomethingGetModelOnce() { $model = $this->getModel(); for ($i = 0; $i < 1000; $i++) { $model->get(); } } public function doSomethingGetModelNTimes() { for ($i = 0; $i < 1000; $i++) { $this->getModel()->get(); } } protected function getModel() { return $this->model; } } $foo = new Foo(); $time0 = microtime(true); $foo->doSomethingGetModelOnce(); $time1 = microtime(true); $foo->doSomethingGetModelNTimes(); $time2 = microtime(true); var_dump(1000*($time1-$time0), 1000*($time2-$time1));

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.0110.00715.11
7.3.120.0060.00914.99
7.3.110.0030.01414.91
7.3.100.0050.00514.93
7.3.90.0060.00914.86
7.3.80.0060.00315.13
7.3.70.0080.00514.93
7.3.60.0120.00314.46
7.3.50.0110.00414.95
7.3.40.0070.00714.95
7.3.30.0030.00714.86
7.3.20.0120.00416.42
7.3.10.0070.00716.70
7.3.00.0070.00716.70
7.2.250.0090.00914.69
7.2.240.0060.01214.82
7.2.230.0040.01115.22
7.2.220.0130.00314.82
7.2.210.0000.01415.29
7.2.200.0110.00715.08
7.2.190.0040.01115.10
7.2.180.0100.00715.05
7.2.170.0030.01015.18
7.2.00.0040.01119.56
7.1.330.0060.00915.79
7.1.320.0100.00615.73
7.1.310.0090.00615.77
7.1.300.0060.00915.89
7.1.290.0030.00915.81
7.1.280.0030.01215.58
7.1.270.0030.01215.64
7.1.260.0040.00815.65
7.1.70.0040.01117.18
7.1.60.0090.01519.30
7.1.50.0060.01617.06
7.1.00.0030.07722.30
7.0.200.0140.00416.72
7.0.140.0100.06722.19
7.0.120.0030.07322.16
7.0.60.0170.07720.00
7.0.50.0100.07317.91
7.0.40.0070.06017.72
7.0.30.0100.04017.71
7.0.20.0030.05317.74
7.0.10.0100.07717.79
7.0.00.0100.04317.84
5.6.280.0030.07321.13
5.6.210.0100.08320.61
5.6.200.0000.04318.13
5.6.190.0200.07018.17
5.6.180.0170.07318.29
5.6.170.0030.04718.23
5.6.160.0030.08018.16
5.6.150.0030.08718.22
5.6.140.0070.08018.21
5.6.130.0170.08018.18
5.6.120.0000.04718.11
5.6.110.0100.08018.20
5.6.100.0030.05018.11
5.6.90.0070.04018.26
5.6.80.0070.06717.63
5.6.70.0070.08017.56
5.6.60.0100.06317.64
5.6.50.0100.03317.54
5.6.40.0130.06717.57
5.6.30.0130.04717.48
5.6.20.0070.06317.51
5.6.10.0030.07317.57
5.6.00.0100.07717.51
5.5.350.0070.08020.50
5.5.340.0030.04317.99
5.5.330.0070.07717.95
5.5.320.0070.08017.99
5.5.310.0030.05018.07
5.5.300.0170.05717.97
5.5.290.0170.07317.94
5.5.280.0070.08018.05
5.5.270.0000.08317.93
5.5.260.0030.05717.94
5.5.250.0070.07017.80
5.5.240.0070.10017.32
5.5.230.0070.04317.37
5.5.220.0000.08017.30
5.5.210.0100.07717.43
5.5.200.0030.07717.35
5.5.190.0100.03717.29
5.5.180.0030.04717.39
5.5.160.0030.08017.32
5.5.150.0130.06017.34
5.5.140.0070.08017.27
5.5.130.0130.07017.36
5.5.120.0030.08317.36
5.5.110.0000.06317.32
5.5.100.0030.06017.34
5.5.90.0070.04017.19
5.5.80.0070.04317.29
5.5.70.0100.03317.24
5.5.60.0170.05717.21
5.5.50.0030.03717.29
5.5.40.0130.05017.17
5.5.30.0100.06717.21
5.5.20.0100.06717.32
5.5.10.0030.05717.21
5.5.00.0070.06017.24
5.4.450.0100.08319.43
5.4.440.0000.04319.45
5.4.430.0200.06719.27
5.4.420.0100.07719.30
5.4.410.0170.03719.16
5.4.400.0100.07719.14
5.4.390.0030.07019.04
5.4.380.0100.06719.04
5.4.370.0030.06019.05
5.4.360.0130.06719.04
5.4.350.0130.06019.04
5.4.340.0170.03318.95
5.4.320.0070.08319.09
5.4.310.0070.06019.13
5.4.300.0100.07319.09
5.4.290.0130.07319.27
5.4.280.0130.07718.95
5.4.270.0130.07019.07
5.4.260.0030.05319.28
5.4.250.0000.07719.03
5.4.240.0100.07718.94
5.4.230.0030.04718.89
5.4.220.0100.07319.09
5.4.210.0000.05019.00
5.4.200.0070.03719.09
5.4.190.0070.06719.03
5.4.180.0000.04019.08
5.4.170.0130.04719.25
5.4.160.0100.05718.98
5.4.150.0130.03019.07
5.4.140.0000.08016.29
5.4.130.0070.07316.44
5.4.120.0000.04316.39
5.4.110.0030.08016.50
5.4.100.0100.07016.43
5.4.90.0100.05316.43
5.4.80.0030.04016.62
5.4.70.0030.04716.33
5.4.60.0000.05016.27
5.4.50.0130.05716.52
5.4.40.0100.07316.62
5.4.30.0070.07316.39
5.4.20.0070.07316.36
5.4.10.0070.08016.37
5.4.00.0070.07316.02
5.3.290.0100.07314.74
5.3.280.0030.04314.60
5.3.270.0100.07314.83
5.3.260.0070.08014.68
5.3.250.0030.06314.60
5.3.240.0070.08014.67
5.3.230.0100.07714.70
5.3.220.0100.06014.60
5.3.210.0030.04314.63
5.3.200.0100.08014.64
5.3.190.0130.04014.68
5.3.180.0030.05014.42
5.3.170.0030.04014.54
5.3.160.0030.04014.63
5.3.150.0030.07714.60
5.3.140.0130.05714.57
5.3.130.0100.07314.61
5.3.120.0100.07714.52
5.3.110.0100.07014.41
5.3.100.0070.07314.08
5.3.90.0030.04714.09
5.3.80.0030.04014.09
5.3.70.0030.04714.03
5.3.60.0070.04314.21
5.3.50.0030.04713.98
5.3.40.0070.05013.85
5.3.30.0030.06013.92
5.3.20.0130.06713.75
5.3.10.0070.07713.67
5.3.00.0030.04013.68
5.2.170.0030.03711.20
5.2.160.0030.05011.05
5.2.150.0070.06011.05
5.2.140.0130.05311.23
5.2.130.0070.03711.17
5.2.120.0070.06311.15
5.2.110.0000.06011.08
5.2.100.0070.03311.12
5.2.90.0170.02711.13
5.2.80.0030.03010.95
5.2.70.0000.04310.99
5.2.60.0070.04710.91
5.2.50.0070.05311.13
5.2.40.0030.06011.11
5.2.30.0000.05711.01
5.2.20.0070.06311.01
5.2.10.0030.06010.83
5.2.00.0030.06310.82
5.1.60.0030.05310.07
5.1.50.0030.05310.04
5.1.40.0000.0439.96
5.1.30.0030.05710.55
5.1.20.0070.04310.46
5.1.10.0030.04310.11
5.1.00.0070.05710.14
5.0.50.0070.0238.61
5.0.40.0000.0508.31
5.0.30.0030.0678.32
5.0.20.0000.0238.34
5.0.10.0000.0278.17
5.0.00.0030.0708.16
4.4.90.0070.0177.71
4.4.80.0000.0337.71
4.4.70.0000.0407.71
4.4.60.0030.0277.71
4.4.50.0000.0207.71
4.4.40.0070.0537.71
4.4.30.0000.0337.71
4.4.20.0030.0377.71
4.4.10.0030.0307.71
4.4.00.0030.0507.71
4.3.110.0000.0377.71
4.3.100.0000.0237.71
4.3.90.0030.0137.71
4.3.80.0000.0337.71
4.3.70.0000.0407.71
4.3.60.0000.0337.71
4.3.50.0000.0377.71
4.3.40.0000.0537.71
4.3.30.0000.0307.71
4.3.20.0000.0377.71
4.3.10.0000.0207.71
4.3.00.0000.0207.71

preferences:
37.87 ms | 400 KiB | 5 Q