3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Amount { private $_list = array(); protected $_number; public function __construct($number) { $this->_number = $number; } public function add(Amount $a) { array_push($this->_list, $this->_number); unset($this->_number); array_push($this->_list, $a->_number); $this->_number += $a->_number; } } $x = new Amount(2); $y = new Amount(3); var_dump($x->add($y));

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)
8.3.60.0070.01116.63
8.3.50.0090.00922.88
8.3.40.0150.00018.79
8.3.30.0070.00719.03
8.3.20.0000.00720.39
8.3.10.0000.00821.89
8.3.00.0040.00417.91
8.2.180.0120.00316.75
8.2.170.0090.00922.96
8.2.160.0100.00320.36
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0070.00720.89
8.2.110.0030.00622.00
8.2.100.0060.00617.65
8.2.90.0040.00419.08
8.2.80.0000.00817.97
8.2.70.0080.00317.35
8.2.60.0030.00918.05
8.2.50.0040.00418.07
8.2.40.0000.00718.03
8.2.30.0080.00017.98
8.2.20.0000.00717.63
8.2.10.0050.00318.12
8.2.00.0040.00417.74
8.1.280.0100.00325.92
8.1.270.0060.00323.93
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0100.00723.93
8.1.230.0110.00019.09
8.1.220.0050.00317.75
8.1.210.0080.00018.77
8.1.200.0000.00917.25
8.1.190.0000.00817.25
8.1.180.0030.00518.10
8.1.170.0000.00818.49
8.1.160.0040.00421.86
8.1.150.0020.00518.83
8.1.140.0000.00717.31
8.1.130.0030.00617.71
8.1.120.0000.00717.39
8.1.110.0000.00717.39
8.1.100.0070.00017.33
8.1.90.0000.00717.24
8.1.80.0040.00417.45
8.1.70.0000.00717.29
8.1.60.0030.00617.43
8.1.50.0030.00517.57
8.1.40.0030.00517.56
8.1.30.0040.00417.48
8.1.20.0050.00317.66
8.1.10.0000.00817.62
8.1.00.0080.00017.43
8.0.300.0000.00818.77
8.0.290.0030.00616.75
8.0.280.0090.00018.45
8.0.270.0000.00817.16
8.0.260.0030.00317.20
8.0.250.0050.00316.94
8.0.240.0030.00716.81
8.0.230.0070.00317.00
8.0.220.0030.00316.82
8.0.210.0040.00416.89
8.0.200.0070.00016.98
8.0.190.0050.00217.03
8.0.180.0000.00716.81
8.0.170.0050.00216.82
8.0.160.0080.00016.88
8.0.150.0030.00316.75
8.0.140.0040.00416.87
8.0.130.0060.00013.38
8.0.120.0050.00316.77
8.0.110.0070.00016.91
8.0.100.0050.00216.89
8.0.90.0040.00416.79
8.0.80.0100.00716.87
8.0.70.0000.00816.95
8.0.60.0080.00016.89
8.0.50.0050.00316.97
8.0.30.0120.00917.11
8.0.20.0150.00517.44
8.0.10.0030.00517.01
8.0.00.0100.00816.78
7.4.330.0030.00315.09
7.4.320.0020.00516.44
7.4.300.0050.00216.58
7.4.290.0000.00816.54
7.4.280.0070.00016.52
7.4.270.0000.00716.44
7.4.260.0070.00016.49
7.4.250.0000.00716.58
7.4.240.0050.00216.62
7.4.230.0000.00716.61
7.4.220.0070.01116.47
7.4.210.0120.00316.56
7.4.200.0000.00716.61
7.4.160.0150.00016.56
7.4.150.0070.01117.40
7.4.140.0100.00817.86
7.4.130.0080.01116.49
7.4.120.0070.01016.49
7.4.110.0090.01216.33
7.4.100.0060.01116.72
7.4.90.0040.01416.26
7.4.80.0140.00519.39
7.4.70.0070.01016.52
7.4.60.0060.01016.44
7.4.50.0020.00216.30
7.4.40.0080.00816.80
7.4.30.0110.00516.50
7.4.00.0040.01214.65
7.3.330.0030.00313.17
7.3.320.0030.00313.23
7.3.310.0030.00316.20
7.3.300.0070.00016.23
7.3.290.0100.00316.29
7.3.280.0090.00816.31
7.3.270.0070.01017.40
7.3.260.0070.01116.61
7.3.250.0070.01016.51
7.3.240.0130.00416.38
7.3.230.0100.00616.39
7.3.210.0140.00816.27
7.3.200.0100.01019.39
7.3.190.0090.01216.45
7.3.180.0030.01216.43
7.3.170.0130.00316.32
7.3.160.0090.00616.46
7.3.120.0060.00914.74
7.3.10.0030.00916.72
7.3.00.0060.00616.36
7.2.330.0030.01416.80
7.2.320.0040.01516.60
7.2.310.0030.01316.77
7.2.300.0090.00916.36
7.2.290.0080.00916.60
7.2.130.0060.00316.77
7.2.120.0060.00617.06
7.2.110.0090.00616.79
7.2.100.0110.00316.87
7.2.90.0000.01517.20
7.2.80.0040.00817.05
7.2.70.0030.01016.65
7.2.60.0130.00317.00
7.2.50.0110.00316.79
7.2.40.0080.00417.15
7.2.30.0030.01016.91
7.2.20.0070.00716.92
7.2.10.0130.00016.72
7.2.00.0080.00516.90
7.1.250.0090.00315.83
7.1.70.0030.00517.00
7.1.60.0140.01119.40
7.1.50.0110.01116.69
7.1.00.0100.07022.46
7.0.200.0070.00316.77
7.0.140.0030.07322.09
7.0.60.0130.08019.99
7.0.50.0030.07717.80
7.0.40.0100.08320.12
7.0.30.0500.07720.08
7.0.20.0200.08320.12
7.0.10.0070.08720.24
7.0.00.0170.08320.33
5.6.280.0100.08720.79
5.6.210.0170.07020.51
5.6.200.0070.03718.27
5.6.190.0100.04720.64
5.6.180.0230.06320.64
5.6.170.0130.04720.45
5.6.160.0030.07320.71
5.6.150.0030.04018.29
5.6.140.0130.06318.15
5.6.130.0130.03018.28
5.6.120.0100.08021.00
5.6.110.0070.08720.99
5.6.100.0030.04020.93
5.6.90.0070.07021.13
5.6.80.0000.04020.40
5.5.350.0000.03320.45
5.5.340.0000.04717.95
5.5.330.0030.08720.31
5.5.320.0170.06720.33
5.5.310.0230.04320.24
5.5.300.0030.07017.93
5.5.290.0070.05017.93
5.5.280.0070.04720.74
5.5.270.0100.05020.73
5.5.260.0030.08720.88
5.5.250.0130.04020.59
5.5.240.0130.03320.19
5.4.450.0070.04719.30
5.4.440.0630.04719.42
5.4.430.0270.04719.32
5.4.420.0430.03319.54
5.4.410.0430.04719.36
5.4.400.0230.04318.93
5.4.390.0330.04019.22
5.4.380.0730.06318.62
5.4.370.0570.05318.77
5.4.360.0830.06018.68
5.4.350.0530.05718.56
5.4.340.0770.05718.56
5.4.320.0070.03512.50
5.4.310.0010.04212.50
5.4.300.0060.03512.50
5.4.290.0060.03712.50
5.4.280.0090.03112.39
5.4.270.0060.03512.40
5.4.260.0050.03712.40
5.4.250.0070.03512.40
5.4.240.0040.04112.40
5.4.230.0040.04212.39
5.4.220.0060.03812.39
5.4.210.0060.03912.39
5.4.200.0050.04212.39
5.4.190.0050.03712.39
5.4.180.0050.03612.39
5.4.170.0050.03612.40
5.4.160.0040.03612.39
5.4.150.0030.03812.39
5.4.140.0080.03712.08
5.4.130.0080.03612.06
5.4.120.0070.03712.02
5.4.110.0040.04012.01
5.4.100.0050.03912.01
5.4.90.0060.03912.02
5.4.80.0080.04512.02
5.4.70.0050.03512.01
5.4.60.0060.03412.01
5.4.50.0050.03512.01
5.4.40.0040.03512.00
5.4.30.0020.03812.00
5.4.20.0040.03712.00
5.4.10.0060.03312.00
5.4.00.0040.03611.48
5.3.290.0040.04612.80
5.3.280.0050.03712.71
5.3.270.0030.04112.72
5.3.260.0080.04312.72
5.3.250.0050.03812.72
5.3.240.0050.04112.72
5.3.230.0080.03812.70
5.3.220.0060.03512.68
5.3.210.0060.04212.68
5.3.200.0030.04012.68
5.3.190.0060.03912.68
5.3.180.0080.03412.67
5.3.170.0040.03712.67
5.3.160.0050.03612.68
5.3.150.0050.03812.68
5.3.140.0030.03912.66
5.3.130.0100.03412.65
5.3.120.0050.04212.66
5.3.110.0050.04112.66
5.3.100.0040.04912.14
5.3.90.0040.03712.11
5.3.80.0070.03812.10
5.3.70.0050.03812.10
5.3.60.0110.03512.08
5.3.50.0080.03512.03
5.3.40.0040.03912.03
5.3.30.0050.03511.99
5.3.20.0030.03911.77
5.3.10.0060.03211.74
5.3.00.0030.03711.73
5.2.170.0030.0319.22
5.2.160.0030.0309.23
5.2.150.0070.0329.23
5.2.140.0030.0369.22
5.2.130.0050.0289.18
5.2.120.0060.0269.18
5.2.110.0060.0279.19
5.2.100.0020.0359.18
5.2.90.0070.0259.18
5.2.80.0060.0299.18
5.2.70.0050.0309.18
5.2.60.0040.0349.14
5.2.50.0060.0299.10
5.2.40.0070.0269.08
5.2.30.0060.0289.06
5.2.20.0060.0269.04
5.2.10.0050.0268.95
5.2.00.0050.0288.81
5.1.60.0020.0258.10
5.1.50.0040.0308.09
5.1.40.0060.0278.07
5.1.30.0010.0288.42
5.1.20.0060.0328.45
5.1.10.0050.0258.17
5.1.00.0080.0298.17
5.0.50.0070.0166.64
5.0.40.0030.0236.50
5.0.30.0050.0296.32
5.0.20.0040.0196.29
5.0.10.0050.0186.26
5.0.00.0030.0316.25
4.4.90.0050.0174.78
4.4.80.0050.0164.75
4.4.70.0020.0204.76
4.4.60.0020.0254.76
4.4.50.0030.0144.77
4.4.40.0030.0274.70
4.4.30.0050.0184.76
4.4.20.0060.0144.85
4.4.10.0020.0164.85
4.4.00.0030.0304.76
4.3.110.0040.0204.67
4.3.100.0020.0154.66
4.3.90.0040.0194.64
4.3.80.0010.0254.59
4.3.70.0020.0154.63
4.3.60.0030.0164.63
4.3.50.0020.0164.63
4.3.40.0000.0284.53
4.3.30.0020.0203.30
4.3.20.0020.0153.28
4.3.10.0020.0153.23
4.3.00.0070.01715.17

preferences:
47.34 ms | 401 KiB | 5 Q