3v4l.org

run code in 300+ 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; $list->array_search('adf');

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.0130.00318.55
8.3.50.0130.00718.33
8.3.40.0150.00018.84
8.3.30.0130.00318.69
8.3.20.0040.00421.75
8.3.10.0080.00023.39
8.3.00.0000.00819.55
8.2.180.0110.00718.54
8.2.170.0040.01122.96
8.2.160.0040.01122.11
8.2.150.0030.00525.66
8.2.140.0030.00524.66
8.2.130.0030.00521.04
8.2.120.0040.00426.35
8.2.110.0030.00822.31
8.2.100.0040.00817.84
8.2.90.0070.00318.34
8.2.80.0000.00918.05
8.2.70.0000.00817.93
8.2.60.0000.00818.28
8.2.50.0050.00318.10
8.2.40.0000.00720.59
8.2.30.0070.00019.45
8.2.20.0090.00018.18
8.2.10.0040.00418.01
8.2.00.0070.00018.20
8.1.280.0130.00725.92
8.1.270.0060.00322.01
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0040.00422.01
8.1.230.0060.00619.16
8.1.220.0090.00017.74
8.1.210.0000.00918.77
8.1.200.0030.00717.35
8.1.190.0000.00817.22
8.1.180.0080.00018.10
8.1.170.0000.00918.64
8.1.160.0070.00018.92
8.1.150.0040.00418.92
8.1.140.0070.00017.74
8.1.130.0050.00317.45
8.1.120.0040.00417.39
8.1.110.0070.00017.48
8.1.100.0050.00217.39
8.1.90.0040.00417.46
8.1.80.0040.00417.47
8.1.70.0040.00417.50
8.1.60.0000.01017.49
8.1.50.0000.00817.44
8.1.40.0040.00417.58
8.1.30.0030.00617.53
8.1.20.0000.00817.59
8.1.10.0080.00017.46
8.1.00.0060.00317.52
8.0.300.0050.00219.78
8.0.290.0080.00016.75
8.0.280.0050.00318.47
8.0.270.0000.00816.92
8.0.260.0000.00616.91
8.0.250.0060.00317.04
8.0.240.0080.00017.00
8.0.230.0030.00317.09
8.0.220.0030.00317.02
8.0.210.0000.00716.86
8.0.200.0070.00017.06
8.0.190.0030.00617.08
8.0.180.0050.00217.06
8.0.170.0070.00317.00
8.0.160.0040.00416.94
8.0.150.0030.00516.86
8.0.140.0000.00716.98
8.0.130.0000.00613.38
8.0.120.0040.00416.93
8.0.110.0050.00316.87
8.0.100.0040.00416.93
8.0.90.0000.00717.01
8.0.80.0060.00916.91
8.0.70.0000.00816.99
8.0.60.0050.00317.05
8.0.50.0040.00416.92
8.0.30.0060.01317.17
8.0.20.0070.01317.40
8.0.10.0000.00817.05
8.0.00.0060.01416.95
7.4.330.0020.00216.67
7.4.320.0030.00316.54
7.4.300.0030.00316.65
7.4.290.0050.00216.63
7.4.280.0000.01016.50
7.4.270.0030.00316.63
7.4.260.0000.00816.51
7.4.250.0000.00716.41
7.4.240.0050.00216.55
7.4.230.0040.00416.41
7.4.220.0050.00316.71
7.4.210.0070.01016.56
7.4.200.0000.00716.61
7.4.160.0080.00716.48
7.4.140.0100.00917.86
7.4.130.0100.00716.55
7.4.120.0110.00716.59
7.4.110.0120.00616.64
7.4.100.0070.01016.68
7.4.90.0100.00716.53
7.4.80.0090.01519.39
7.4.70.0060.01616.63
7.4.60.0030.02016.27
7.4.50.0040.01416.51
7.4.40.0080.00816.62
7.4.10.0060.01315.18
7.4.00.0030.01314.99
7.3.330.0000.00513.52
7.3.320.0060.00013.40
7.3.310.0030.00316.51
7.3.300.0000.00716.52
7.3.290.0150.00016.44
7.3.280.0070.00816.49
7.3.260.0120.01116.54
7.3.240.0090.01116.61
7.3.230.0070.01016.70
7.3.210.0100.00716.62
7.3.200.0110.01116.52
7.3.190.0120.00416.68
7.3.180.0110.00716.53
7.3.170.0080.01116.60
7.3.160.0090.00616.59
7.3.130.0070.01015.04
7.3.120.0140.00015.09
7.3.110.0070.01015.00
7.3.100.0030.01014.69
7.3.90.0080.00414.98
7.3.80.0050.00514.84
7.3.70.0030.00714.91
7.3.60.0100.00614.84
7.3.50.0030.00614.81
7.3.40.0120.00014.88
7.3.30.0000.00914.52
7.3.20.0040.01116.47
7.3.10.0070.00316.49
7.3.00.0020.00816.66
7.2.330.0100.01016.88
7.2.320.0120.00916.89
7.2.310.0060.01216.74
7.2.300.0110.01116.86
7.2.290.0080.01116.72
7.2.260.0000.01615.31
7.2.250.0030.01415.35
7.2.240.0030.01015.16
7.2.230.0020.01315.39
7.2.220.0040.01115.02
7.2.210.0130.00314.91
7.2.200.0070.00715.07
7.2.190.0060.00915.00
7.2.180.0000.01115.16
7.2.170.0030.01015.06
7.2.160.0040.00815.09
7.2.150.0060.00916.94
7.2.140.0060.00316.77
7.2.130.0080.00517.00
7.2.120.0120.00017.04
7.2.110.0060.00916.99
7.2.100.0050.00816.83
7.2.90.0050.00916.97
7.2.80.0060.00616.99
7.2.70.0060.00616.81
7.2.60.0070.00716.78
7.2.50.0090.00516.84
7.2.40.0610.01017.49
7.2.30.0390.01117.16
7.2.20.0350.00717.27
7.2.10.0370.01017.30
7.2.00.0530.00917.31
7.1.330.0040.01115.71
7.1.320.0070.01115.96
7.1.310.0030.01015.67
7.1.300.0060.00815.89
7.1.290.0040.00815.95
7.1.280.0030.01415.75
7.1.270.0040.01115.98
7.1.260.0030.00915.80
7.1.250.0030.00715.78
7.1.240.0040.01215.63
7.1.230.0000.01315.57
7.1.220.0140.00415.73
7.1.210.0060.00615.79
7.1.200.0050.00715.93
7.1.190.0080.00415.95
7.1.180.0090.00615.54
7.1.170.0060.00915.55
7.1.160.0640.01216.21
7.1.150.0630.00816.37
7.1.140.0560.01316.32
7.1.130.0620.00916.22
7.1.120.0520.01016.28
7.1.110.0760.00915.93
7.1.100.0640.00915.84
7.1.90.0380.01115.85
7.1.80.0420.00815.91
7.1.70.0870.00815.57
7.1.60.0670.01424.48
7.1.50.0640.01324.31
7.1.40.0950.01424.03
7.1.30.0600.00924.32
7.1.20.0170.01324.21
7.1.10.0680.00715.24
7.1.00.0690.01315.48
7.0.330.0030.00515.18
7.0.320.0100.00715.46
7.0.310.0040.00415.45
7.0.300.0070.00715.29
7.0.290.0070.00715.30
7.0.280.0070.00715.33
7.0.270.0040.00415.37
7.0.260.0030.00715.43
7.0.250.0100.00315.65
7.0.240.0090.00015.33
7.0.230.0030.01015.43
7.0.220.0030.00615.32
7.0.210.0120.00315.42
7.0.200.0040.01215.53
7.0.190.0050.00915.51
7.0.180.0050.01315.43
7.0.170.0040.00715.19
7.0.160.0040.01115.41
7.0.150.0030.01015.48
7.0.140.0060.00915.27
7.0.130.0030.00915.23
7.0.120.0050.00315.52
7.0.110.0130.00315.38
7.0.100.0090.00615.41
7.0.90.0030.01315.45
7.0.80.0040.00815.45
7.0.70.0070.00715.46
7.0.60.0090.00315.48
7.0.50.0000.01315.38
7.0.40.0080.00013.00
7.0.30.0160.00013.30
7.0.20.0060.00913.41
7.0.10.0030.01013.55
7.0.00.0060.00313.32
5.6.400.0100.00714.09
5.6.390.0100.00314.46
5.6.380.0030.00514.45
5.6.370.0040.00814.16
5.6.360.0040.01114.50
5.6.350.0060.00914.27
5.6.340.0130.00314.13
5.6.330.0070.00314.36
5.6.320.0000.01414.45
5.6.310.0080.00814.43
5.6.300.0000.01614.32
5.6.290.0040.00714.29
5.6.280.0030.01014.37
5.6.270.0060.00613.98
5.6.260.0000.01114.21
5.6.250.0040.01214.29
5.6.240.0000.01114.13
5.6.230.0030.00914.38
5.6.220.0090.00314.54
5.6.210.0080.00314.18
5.6.200.0060.00914.21
5.6.190.0040.00414.11
5.6.180.0100.00714.12
5.6.170.0000.00914.13
5.6.160.0000.01014.25
5.6.150.0040.01114.04
5.6.140.0000.01214.05
5.6.130.0060.00914.13
5.6.120.0070.00714.08
5.6.110.0000.01513.94
5.6.100.0070.01014.30
5.6.90.0100.00014.50
5.6.80.0030.00914.32
5.6.70.0060.00614.15
5.6.60.0000.01114.11
5.6.50.0000.01314.12
5.6.40.0040.01114.28
5.6.30.0100.00314.05
5.6.20.0040.00814.27
5.6.10.0060.00314.09
5.6.00.0000.01014.13

preferences:
62.34 ms | 400 KiB | 5 Q