3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait GenericList { public function __call($func, $argv) { echo "__call called \n"; if (!is_callable($func) || substr($func, 0, 6) !== 'array_') { throw new \BadMethodCallException(__CLASS__.'->'.$func); } return call_user_func_array($func, array_merge(array($this->getArrayCopy()), $argv)); } final public function offsetUnset($offset) { parent::offsetUnset($offset); } final public function sort($preserveKeys = false) { if($preserveKeys) parent::ksort(); else parent::exchangeArray (\Arr::reindex(parent::getArrayCopy ())); } final public function clear(){ parent::exchangeArray([]); } } final class LineItemList extends \ArrayObject { use GenericList; public function offsetSet($offset, $value) { if (!($value instanceof LineItemBase)) { throw new \InvalidArgumentException("Value has to be a instance of LineItemBase"); } parent::offsetSet($offset, $value); } } class LineItemBase{ public $blah; public function __construct(string $blah){ $this->blah = $blah; } } $list = new LineItemList(); $list []= new LineItemBase('SDSdSD'); echo $list [0]->blah;

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.5.70.0100.00616.98
8.5.60.0030.00517.01
8.5.50.0070.00918.64
8.5.30.0110.00719.18
8.5.20.0070.01019.58
8.5.10.0110.00716.94
8.5.00.0140.01520.33
8.4.220.0060.00319.45
8.4.210.0040.00519.68
8.4.180.0170.00619.68
8.4.170.0110.01521.99
8.4.160.0110.01021.97
8.4.150.0080.00516.89
8.4.140.0070.01317.74
8.4.130.0110.00818.98
8.4.120.0050.00417.97
8.4.110.0070.00518.04
8.4.100.0170.00417.88
8.4.90.0130.00720.75
8.4.80.0130.00619.02
8.4.70.0050.00318.91
8.4.60.0060.00218.75
8.4.50.0090.01318.89
8.4.40.0060.00319.82
8.4.30.0130.00618.02
8.4.20.0100.01019.68
8.4.10.0100.01018.52
8.3.310.0110.00918.74
8.3.300.0140.00820.22
8.3.290.0110.00920.80
8.3.280.0110.01018.54
8.3.270.0140.00916.56
8.3.260.0140.00516.63
8.3.250.0060.00716.57
8.3.240.0090.00416.73
8.3.230.0110.00816.78
8.3.220.0090.01019.05
8.3.210.0070.00618.57
8.3.200.0080.00816.79
8.3.190.0080.01117.27
8.3.180.0080.01118.84
8.3.170.0140.00720.65
8.3.160.0110.00717.18
8.3.150.0080.00017.15
8.3.140.0050.00520.91
8.3.130.0060.00316.90
8.3.120.0130.00318.98
8.3.110.0090.00020.94
8.3.100.0030.00724.06
8.3.90.0040.00426.77
8.3.80.0040.00418.56
8.3.70.0040.01416.50
8.3.60.0220.00018.68
8.3.50.0100.00618.37
8.3.40.0090.00618.82
8.3.30.0100.01018.74
8.3.20.0070.00021.84
8.3.10.0000.00823.66
8.3.00.0050.00318.05
8.2.300.0130.00922.19
8.2.290.0090.00916.81
8.2.280.0130.00618.80
8.2.270.0110.00716.55
8.2.260.0160.00317.20
8.2.250.0120.00616.62
8.2.240.0090.00019.07
8.2.230.0040.00722.58
8.2.220.0030.00637.54
8.2.210.0070.00326.77
8.2.200.0090.00016.38
8.2.190.0070.00718.78
8.2.180.0080.01118.29
8.2.170.0120.00322.96
8.2.160.0170.00319.27
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00420.93
8.2.120.0040.00426.35
8.2.110.0070.00319.32
8.2.100.0000.01117.91
8.2.90.0060.00317.84
8.2.80.0080.00018.20
8.2.70.0040.00417.93
8.2.60.0030.00517.93
8.2.50.0000.00818.22
8.2.40.0040.00420.65
8.2.30.0040.00419.51
8.2.20.0050.00318.07
8.2.10.0040.00418.05
8.2.00.0060.00318.01
8.1.340.0110.01023.49
8.1.330.0120.00816.46
8.1.320.0150.00417.87
8.1.310.0150.00016.77
8.1.300.0080.01219.59
8.1.290.0040.00430.84
8.1.280.0180.00725.92
8.1.270.0080.00021.93
8.1.260.0030.00526.35
8.1.250.0000.00928.09
8.1.240.0030.00619.50
8.1.230.0060.00620.80
8.1.220.0000.00817.74
8.1.210.0040.00420.57
8.1.200.0000.00917.25
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0030.00518.57
8.1.160.0040.00418.91
8.1.150.0000.00720.80
8.1.140.0070.00017.70
8.1.130.0000.00718.96
8.1.120.0000.00717.52
8.1.110.0050.00317.50
8.1.100.0080.00017.43
8.1.90.0050.00217.51
8.1.80.0000.00717.35
8.1.70.0000.00917.49
8.1.60.0040.00817.61
8.1.50.0050.00317.57
8.1.40.0000.00817.60
8.1.30.0040.00417.58
8.1.20.0050.00217.67
8.1.10.0000.00817.50
8.1.00.0060.00317.54
8.0.300.0040.00420.00
8.0.290.0050.00216.75
8.0.280.0080.00018.38
8.0.270.0000.00717.36
8.0.260.0000.00717.17
8.0.250.0070.00316.95
8.0.240.0040.00416.90
8.0.230.0000.00716.85
8.0.220.0000.00816.90
8.0.210.0070.00016.93
8.0.200.0040.00416.93
8.0.190.0040.00416.95
8.0.180.0000.00716.83
8.0.170.0090.00316.93
8.0.160.0040.00416.94
8.0.150.0000.00816.84
8.0.140.0030.00316.82
8.0.130.0030.00313.38
8.0.120.0050.00316.85
8.0.110.0070.00016.75
8.0.100.0040.00417.02
8.0.90.0080.00016.90
8.0.80.0070.01416.96
8.0.70.0000.00816.86
8.0.60.0040.00416.79
8.0.50.0080.00016.85
8.0.30.0120.00617.13
8.0.20.0090.00917.40
8.0.10.0000.00716.98
8.0.00.0080.01016.75
7.4.330.0000.00516.84
7.4.320.0000.00816.48
7.4.300.0070.00016.42
7.4.290.0050.00316.50
7.4.280.0090.00016.65
7.4.270.0030.00316.53
7.4.260.0000.00716.64
7.4.250.0050.00316.63
7.4.240.0000.00716.47
7.4.230.0090.00016.71
7.4.220.0000.00816.70
7.4.210.0030.01016.52
7.4.200.0030.00316.64
7.4.160.0090.00816.50
7.4.140.0080.01017.86
7.4.130.0120.00816.62
7.4.120.0100.00716.59
7.4.110.0100.01416.56
7.4.100.0070.01016.65
7.4.90.0130.00516.62
7.4.80.0090.00919.39
7.4.70.0110.01616.66
7.4.60.0120.00416.39
7.4.50.0040.01516.66
7.4.40.0160.00016.25
7.4.10.0050.01314.93
7.4.00.0090.00914.79
7.3.330.0020.00213.21
7.3.320.0060.00013.39
7.3.310.0040.00216.50
7.3.300.0040.00416.41
7.3.290.0040.00416.37
7.3.280.0080.00816.38
7.3.260.0120.00516.46
7.3.240.0110.00716.52
7.3.230.0160.00016.31
7.3.210.0030.01316.44
7.3.200.0090.00916.48
7.3.190.0110.00616.62
7.3.180.0110.00516.39
7.3.170.0060.01216.46
7.3.160.0090.00616.51
7.3.130.0030.01514.98
7.3.120.0070.01114.86
7.3.110.0070.01014.95
7.3.100.0050.00914.88
7.3.90.0050.00714.97
7.3.80.0030.00914.94
7.3.70.0050.00914.81
7.3.60.0070.00814.81
7.3.50.0080.00714.83
7.3.40.0050.00814.82
7.3.30.0080.00614.79
7.3.20.0040.00816.51
7.3.10.0080.00816.72
7.3.00.0050.01016.58
7.2.330.0130.01016.36
7.2.320.0040.01816.58
7.2.310.0140.00316.72
7.2.300.0170.00016.49
7.2.290.0090.00916.84
7.2.260.0110.00315.10
7.2.250.0080.00815.04
7.2.240.0050.01214.85
7.2.230.0070.00915.10
7.2.220.0050.01115.01
7.2.210.0030.01015.07
7.2.200.0040.01114.95
7.2.190.0060.00715.08
7.2.180.0060.00815.19
7.2.170.0050.00815.05
7.2.160.0080.00815.05
7.2.150.0070.00916.91
7.2.140.0080.00616.74
7.2.130.0070.00616.91
7.2.120.0040.01016.89
7.2.110.0060.00816.98
7.2.100.0040.00916.95
7.2.90.0080.00716.85
7.2.80.0080.00816.97
7.2.70.0070.00316.75
7.2.60.0050.00916.84
7.2.50.0040.01017.08
7.2.40.0440.00917.52
7.2.30.0300.01217.32
7.2.20.0270.01017.41
7.2.10.0250.01017.26
7.2.00.0340.00717.37
7.1.330.0040.00915.85
7.1.320.0060.00615.81
7.1.310.0040.00915.82
7.1.300.0040.01015.84
7.1.290.0050.00615.74
7.1.280.0070.00515.81
7.1.270.0020.01015.84
7.1.260.0030.01015.63
7.1.250.0020.00916.00
7.1.240.0100.00315.86
7.1.230.0060.00615.74
7.1.220.0090.00215.70
7.1.210.0030.01015.86
7.1.200.0050.00715.73
7.1.190.0070.00515.76
7.1.180.0020.01115.74
7.1.170.0100.00215.85
7.1.160.0310.00716.17
7.1.150.0200.01316.20
7.1.140.0220.00916.15
7.1.130.0270.00916.22
7.1.120.0290.01316.25
7.1.110.0400.00716.12
7.1.100.0450.01415.85
7.1.90.0390.00815.90
7.1.80.0500.00916.03
7.1.70.0470.00815.70
7.1.60.0330.01121.37
7.1.50.0450.00921.52
7.1.40.0320.00821.42
7.1.30.0510.00621.42
7.1.20.0480.01321.46
7.1.10.0470.00815.48
7.1.00.0490.00815.40
7.0.330.0060.00815.43
7.0.320.0060.00815.48
7.0.310.0040.00815.37
7.0.300.0060.00315.45
7.0.290.0040.01215.34
7.0.280.0050.00815.52
7.0.270.0060.00915.44
7.0.260.0020.00915.38
7.0.250.0070.00315.42
7.0.240.0050.00815.35
7.0.230.0110.00315.59
7.0.220.0040.00715.45
7.0.210.0030.00915.56
7.0.200.0050.00815.41
7.0.190.0060.00415.44
7.0.180.0070.00715.40
7.0.170.0060.00915.35
7.0.160.0070.00415.27
7.0.150.0050.00615.30
7.0.140.0030.00815.51
7.0.130.0040.00915.50
7.0.120.0060.00615.37
7.0.110.0050.00515.33
7.0.100.0050.00815.55
7.0.90.0070.00715.42
7.0.80.0050.00515.22
7.0.70.0070.00515.52
7.0.60.0050.00815.54
7.0.50.0040.00915.46
7.0.40.0050.00613.50
7.0.30.0020.00913.56
7.0.20.0050.00713.31
7.0.10.0060.00413.42
7.0.00.0080.00213.38
5.6.400.0070.01014.33
5.6.390.0050.00814.48
5.6.380.0070.00514.42
5.6.370.0050.00514.23
5.6.360.0020.01014.48
5.6.350.0030.01414.43
5.6.340.0050.01114.57
5.6.330.0050.01014.36
5.6.320.0120.00214.60
5.6.310.0060.00614.37
5.6.300.0080.00614.52
5.6.290.0050.00514.54
5.6.280.0030.00814.29
5.6.270.0050.00914.33
5.6.260.0050.00714.40
5.6.250.0070.00514.36
5.6.240.0030.01214.19
5.6.230.0050.00914.34
5.6.220.0070.00714.29
5.6.210.0070.00414.28
5.6.200.0080.00614.11
5.6.190.0060.00914.44
5.6.180.0030.01114.33
5.6.170.0060.00814.30
5.6.160.0040.01114.40
5.6.150.0100.00314.17
5.6.140.0020.01314.38
5.6.130.0050.00914.39
5.6.120.0080.00814.39
5.6.110.0000.01414.08
5.6.100.0100.00714.16
5.6.90.0090.00614.28
5.6.80.0080.00714.26
5.6.70.0040.01014.08
5.6.60.0040.00814.18
5.6.50.0020.00914.38
5.6.40.0060.00814.41
5.6.30.0110.00314.43
5.6.20.0040.00914.29
5.6.10.0050.01013.99
5.6.00.0080.00714.29

preferences:
121.85 ms | 2026 KiB | 5 Q