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 < 1000000; $i++) { $model->get(); } } public function doSomethingGetModelNTimes() { for ($i = 0; $i < 1000000; $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.0130.13515.08
7.3.120.0030.15214.52
7.3.110.0030.14214.80
7.3.100.0070.09014.83
7.3.90.0060.08814.84
7.3.80.0030.13014.73
7.3.70.0070.13214.74
7.3.60.0070.09214.82
7.3.50.0100.09314.54
7.3.40.0070.08514.63
7.3.30.0070.09614.73
7.3.20.0100.08816.84
7.3.10.0020.09016.77
7.3.00.0050.11016.54
7.2.250.0030.15215.23
7.2.240.0160.11515.01
7.2.230.0030.12115.31
7.2.220.0030.11015.21
7.2.210.0070.10114.59
7.2.200.0070.09615.09
7.2.190.0030.10215.05
7.2.180.0100.09315.24
7.2.170.0030.10814.91
7.2.160.0030.09914.95
7.2.150.0030.09516.99
7.2.140.0100.10217.06
7.2.130.0020.12316.83
7.2.120.0080.10616.74
7.2.110.0080.12216.79
7.2.100.0070.10616.67
7.2.90.0080.12516.63
7.2.80.0070.09916.81
7.2.70.0070.11116.94
7.2.60.0100.09716.69
7.2.50.0050.10716.81
7.2.40.0050.10916.51
7.2.30.0080.09916.60
7.2.20.0080.10916.77
7.2.10.0070.11216.72
7.2.00.0060.10417.61
7.1.330.0030.26415.73
7.1.320.0070.23315.64
7.1.310.0000.25415.96
7.1.300.0030.21715.92
7.1.290.0000.22715.51
7.1.280.0030.22915.87
7.1.270.0030.23715.92
7.1.260.0030.22215.76
7.1.250.0030.23815.84
7.1.240.0070.21515.76
7.1.230.0070.24215.87
7.1.220.0030.22215.79
7.1.210.0030.23015.76
7.1.200.0100.21115.88
7.1.190.0030.25815.89
7.1.180.0000.23515.55
7.1.170.0070.23115.98
7.1.160.0100.23715.91
7.1.150.0030.22015.95
7.1.140.0030.21215.91
7.1.130.0070.22815.59
7.1.120.0100.23115.85
7.1.110.0030.21715.86
7.1.100.0030.23215.66
7.1.90.0000.27315.56
7.1.80.0030.27215.88
7.1.70.0070.17016.38
7.1.60.0130.18817.80
7.1.50.0070.20116.31
7.1.40.0070.24915.92
7.1.30.0000.25315.91
7.1.20.0000.21715.69
7.1.10.0070.22615.73
7.1.00.0080.21518.91
7.0.330.0030.27015.53
7.0.320.0030.23915.40
7.0.310.0000.21815.46
7.0.300.0070.21215.45
7.0.290.0030.21215.53
7.0.280.0030.22815.45
7.0.270.0100.21115.59
7.0.260.0000.22715.49
7.0.250.0000.26715.45
7.0.240.0000.27015.43
7.0.230.0000.27415.25
7.0.220.0030.21215.42
7.0.210.0000.24415.20
7.0.200.0030.17516.20
7.0.190.0070.22615.68
7.0.180.0030.25515.23
7.0.170.0030.25015.37
7.0.160.0070.22015.57
7.0.150.0000.23615.50
7.0.140.0030.22218.62
7.0.130.0030.25915.20
7.0.120.0030.29015.27
7.0.110.0000.23915.32
7.0.100.0100.20217.67
7.0.90.0070.21217.67
7.0.80.0280.21617.54
7.0.70.0280.22017.60
7.0.60.0330.19417.66
7.0.50.0080.20717.88
7.0.40.0050.21816.79
7.0.30.0080.21516.76
7.0.20.0030.21516.84
7.0.10.0070.21716.70
7.0.00.0030.23516.68
5.6.400.0030.51114.31
5.6.390.0070.52414.48
5.6.380.0030.44714.70
5.6.370.0100.46114.48
5.6.360.0030.45314.52
5.6.350.0070.45914.25
5.6.340.0070.45314.71
5.6.330.0070.51514.53
5.6.320.0000.43914.40
5.6.310.0000.51214.63
5.6.300.0070.42814.27
5.6.290.0100.44714.45
5.6.280.0020.39317.64
5.6.270.0030.43014.41
5.6.260.0070.46114.38
5.6.250.0080.35817.64
5.6.240.0050.39417.45
5.6.230.0070.40817.45
5.6.220.0070.35717.62
5.6.210.0070.36517.54
5.6.200.0120.40717.85
5.6.190.0050.40517.83
5.6.180.0050.38817.66
5.6.170.0050.38017.77
5.6.160.0100.38217.91
5.6.150.0020.38917.80
5.6.140.0080.38617.71
5.6.130.0100.39317.76
5.6.120.0070.40017.67
5.6.110.0000.36617.63
5.6.100.0050.35917.72
5.6.90.0100.39917.84
5.6.80.0080.40517.34
5.6.70.0080.39917.44
5.6.60.0050.38717.30
5.6.50.0070.34217.55
5.6.40.0030.36117.42
5.6.30.0000.40217.52
5.6.20.0030.35117.33
5.6.10.0020.39017.28
5.6.00.0100.34117.25
5.5.380.0050.45317.34
5.5.370.0050.39017.43
5.5.360.0050.41617.40
5.5.350.0120.37717.59
5.5.340.0050.39217.63
5.5.330.0070.39717.73
5.5.320.0080.43917.48
5.5.310.0070.38317.72
5.5.300.0070.39317.63
5.5.290.0070.46017.53
5.5.280.0050.38117.69
5.5.270.0030.42517.47
5.5.260.0070.45317.53
5.5.250.0070.43917.24
5.5.240.0120.37317.17
5.5.230.0070.37217.20
5.5.220.0080.40117.32
5.5.210.0130.40817.29
5.5.200.0050.42217.29
5.5.190.0050.34217.30
5.5.180.0080.37617.12
5.5.170.0030.53014.04
5.5.160.0070.35317.28
5.5.150.0020.38217.24
5.5.140.0070.38217.23
5.5.130.0030.36917.37
5.5.120.0050.42617.15
5.5.110.0030.38517.38
5.5.100.0100.37017.15
5.5.90.0070.36717.26
5.5.80.0070.44117.01
5.5.70.0070.43317.13
5.5.60.0020.40717.02
5.5.50.0020.41717.28
5.5.40.0080.41417.12
5.5.30.0120.40817.20
5.5.20.0050.40817.10
5.5.10.0070.43017.08
5.5.00.0050.41117.24
5.4.450.0080.42415.38
5.4.440.0030.41915.27
5.4.430.0050.38415.19
5.4.420.0030.39415.10
5.4.410.0020.38115.43
5.4.400.0100.42915.02
5.4.390.0050.40315.17
5.4.380.0050.37815.13
5.4.370.0050.41015.07
5.4.360.0020.40415.09
5.4.350.0030.40615.09
5.4.340.0050.40915.09
5.4.330.0030.64011.02
5.4.320.0020.38814.99
5.4.310.0050.37415.17
5.4.300.0170.39214.91
5.4.290.0000.40615.10
5.4.280.0030.41715.21
5.4.270.0050.46015.08
5.4.260.0030.43115.14
5.4.250.0050.44715.13
5.4.240.0070.38214.98
5.4.230.0050.38414.95
5.4.220.0020.40614.97
5.4.210.0070.39115.28
5.4.200.0030.39715.16
5.4.190.0070.46414.91
5.4.180.0070.43914.94
5.4.170.0030.44115.12
5.4.160.0050.40715.13
5.4.150.0120.43615.03
5.4.140.0050.47313.79
5.4.130.0080.46813.79
5.4.120.0070.43213.84
5.4.110.0030.38813.66
5.4.100.0050.43513.58
5.4.90.0020.45013.77
5.4.80.0050.46713.85
5.4.70.0080.39313.86
5.4.60.0070.41613.61
5.4.50.0020.43613.78
5.4.40.0050.45513.61
5.4.30.0030.37813.70
5.4.20.0100.44013.77
5.4.10.0050.41413.79
5.4.00.0020.43013.39
5.3.290.0250.58012.64
5.3.280.0120.76312.56
5.3.270.0080.70012.74
5.3.260.0080.80012.53
5.3.250.0030.66312.69
5.3.240.0030.81112.72
5.3.230.0120.71112.63
5.3.220.0050.72812.53
5.3.210.0020.80712.56
5.3.200.0130.70212.39
5.3.190.0050.62712.53
5.3.180.0050.67012.43
5.3.170.0220.74712.45
5.3.160.0030.73712.70
5.3.150.0030.81812.61
5.3.140.0050.66112.54
5.3.130.0030.80212.46
5.3.120.0020.71912.61
5.3.110.0050.75812.54
5.3.100.0030.75312.33
5.3.90.0070.68112.28
5.3.80.0050.77612.32
5.3.70.0030.67212.28
5.3.60.0020.71312.26
5.3.50.0030.72212.28
5.3.40.0080.73012.17
5.3.30.0030.72512.24
5.3.20.0070.67512.11
5.3.10.0030.67512.03
5.3.00.0130.68411.86
5.2.170.0100.65311.96
5.2.160.0070.62011.96
5.2.150.0030.64711.96
5.2.140.0130.66011.96
5.2.130.0070.64311.96
5.2.120.0030.68011.96
5.2.110.0070.67011.96
5.2.100.0070.70711.96
5.2.90.0070.66711.96
5.2.80.0030.70711.96
5.2.70.0000.66711.96
5.2.60.0030.65711.96
5.2.50.0100.66011.96
5.2.40.0070.66011.96
5.2.30.0000.64011.96
5.2.20.0170.67711.96
5.2.10.0000.71011.96
5.2.00.0070.65311.96
5.1.60.0030.63311.96
5.1.50.0070.66311.96
5.1.40.0000.66011.96
5.1.30.0070.59011.96
5.1.20.0000.56311.96
5.1.10.0030.57711.96
5.1.00.0000.55711.96
5.0.50.0000.76011.96
5.0.40.0000.78011.96
5.0.30.0030.70711.96
5.0.20.0000.65011.96
5.0.10.0000.65311.96
5.0.00.0000.77311.96
4.4.90.0030.02711.96
4.4.80.0000.03711.96
4.4.70.0030.03011.96
4.4.60.0030.03311.96
4.4.50.0100.02711.96
4.4.40.0030.03011.96
4.4.30.0000.01711.96
4.4.20.0000.03011.96
4.4.10.0030.01311.96
4.4.00.0000.05311.96
4.3.110.0000.02011.96
4.3.100.0030.01011.96
4.3.90.0000.01311.96
4.3.80.0000.06011.96
4.3.70.0030.02711.96
4.3.60.0030.02711.96
4.3.50.0100.02711.96
4.3.40.0030.05011.96
4.3.30.0000.02011.96
4.3.20.0000.03011.96
4.3.10.0000.04011.96
4.3.00.0070.03311.96

preferences:
39.37 ms | 401 KiB | 5 Q