3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeHelperClass { public $_arr = []; public function addValue($value, $key = null): void { $this->_arr[$key ?? ((array_key_last($this->_arr) ?? -1) + 1)] = $value; } } $test = new SomeHelperClass; var_export($test->_arr); echo "\n"; $test->addValue(1); var_export($test->_arr); echo "\n"; $test->addValue(2); var_export($test->_arr); echo "\n"; $test->addValue(3, 4); var_export($test->_arr); echo "\n"; $test->addValue(4, 3); var_export($test->_arr); echo "\n"; $test->addValue(5); var_export($test->_arr);

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.4.120.0090.00820.64
8.4.110.0070.00222.54
8.4.100.0150.00618.95
8.4.90.0080.01218.87
8.4.80.0050.00418.83
8.4.70.0040.00420.57
8.4.60.0090.00720.75
8.4.50.0060.00320.38
8.4.40.0080.00017.65
8.4.30.0060.01020.50
8.4.20.0030.00624.15
8.4.10.0090.00023.81
8.3.250.0100.00918.88
8.3.240.0110.00720.70
8.3.230.0100.00816.37
8.3.220.0130.00518.95
8.3.210.0090.00616.79
8.3.200.0070.00216.33
8.3.190.0130.00617.10
8.3.180.0120.00716.53
8.3.170.0060.01217.23
8.3.160.0110.00718.59
8.3.150.0090.00918.97
8.3.140.0120.00617.22
8.3.130.0030.00618.51
8.3.120.0100.01018.85
8.3.110.0070.00320.94
8.3.100.0090.00016.86
8.3.90.0080.00026.77
8.3.80.0040.00818.43
8.3.70.0060.00916.50
8.3.60.0110.01116.63
8.3.50.0130.00618.61
8.3.40.0090.00620.21
8.3.30.0040.01118.70
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.290.0080.01020.46
8.2.280.0190.00718.01
8.2.270.0060.00317.30
8.2.260.0140.00416.61
8.2.250.0030.00618.57
8.2.240.0090.00017.30
8.2.230.0100.01022.58
8.2.220.0000.00924.06
8.2.210.0100.00726.77
8.2.200.0030.00618.29
8.2.190.0090.00918.17
8.2.180.0110.00416.63
8.2.170.0150.00018.90
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0030.00620.88
8.2.100.0080.00417.72
8.2.90.0030.00619.17
8.2.80.0040.00418.03
8.2.70.0000.00817.75
8.2.60.0090.00019.22
8.2.50.0000.00817.63
8.2.40.0060.00317.62
8.2.30.0140.00317.62
8.2.20.0170.00017.62
8.2.10.0140.00217.62
8.2.00.0130.00317.62
8.1.330.0120.00721.78
8.1.320.0080.01217.84
8.1.310.0110.00718.32
8.1.300.0000.00818.32
8.1.290.0100.00030.84
8.1.280.0060.01325.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00522.63
8.1.230.0090.00317.95
8.1.220.0050.00517.79
8.1.210.0000.00818.77
8.1.200.0080.00017.22
8.1.190.0070.00317.39
8.1.180.0030.00618.10
8.1.170.0120.00417.62
8.1.160.0080.00817.62
8.1.150.0080.00817.62
8.1.140.0140.00517.62
8.1.130.0050.01117.62
8.1.120.0080.00817.62
8.1.110.0100.00717.62
8.1.100.0130.00317.62
8.1.90.0110.00417.62
8.1.80.0100.00617.62
8.1.70.0050.01017.62
8.1.60.0130.00517.62
8.1.50.0160.00017.62
8.1.40.0110.01117.62
8.1.30.0090.00917.62
8.1.20.0190.00017.62
8.1.10.0060.01217.62
8.1.00.0170.00317.62
8.0.300.0000.00718.77
8.0.290.0000.00816.63
8.0.280.0060.01017.62
8.0.270.0140.00317.62
8.0.260.0180.00017.62
8.0.250.0030.01317.62
8.0.240.0160.00017.62
8.0.230.0100.00717.62
8.0.220.0130.00317.62
8.0.210.0150.00417.62
8.0.200.0130.00317.62
8.0.190.0080.00817.62
8.0.180.0130.00317.62
8.0.170.0120.00417.62
8.0.160.0130.00417.62
8.0.150.0080.00817.62
8.0.140.0080.00817.62
8.0.130.0100.00517.62
8.0.120.0070.01017.62
8.0.110.0070.01017.62
8.0.100.0160.00317.62
8.0.90.0000.01717.62
8.0.80.0100.00517.62
8.0.70.0100.00617.62
8.0.60.0080.00817.62
8.0.50.0110.00517.62
8.0.30.0160.00017.62
8.0.20.0170.00017.62
8.0.10.0160.00017.62

preferences:
29.62 ms | 403 KiB | 5 Q