3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Ar implements ArrayAccess { private $storage = []; private $offset = null; public function __construct(array $ar) { $this->storage = array_values($ar); $this->offset = 0; } public function offsetExists($offset) { return $offset <= count($this->storage); } public function offsetGet($offset) { return $this->storage[$offset]; } public function offsetSet($offset, $value) { $this->storage[$offset] = $value; } public function offsetUnset($offset) { unset($this->storage[$offset]); $this->storage = array_values($this->storage); } } $obj = new Ar([1,2,3,4,5,6,7]); var_dump(array_values($obj));

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.0060.00916.63
8.3.50.0000.01516.38
8.3.40.0040.01118.82
8.3.30.0060.00918.96
8.3.20.0040.00420.21
8.3.10.0040.00423.61
8.3.00.0090.00317.72
8.2.180.0130.01018.26
8.2.170.0150.00022.96
8.2.160.0030.01720.35
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0040.00421.05
8.2.120.0020.00526.16
8.2.110.0060.00319.30
8.2.100.0090.00318.22
8.2.90.0030.00619.23
8.2.80.0050.00318.05
8.2.70.0080.00017.75
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0050.00320.60
8.2.30.0040.00420.95
8.2.20.0000.00818.07
8.2.10.0040.00418.10
8.2.00.0050.00217.95
8.1.280.0040.01525.92
8.1.270.0040.00423.99
8.1.260.0000.01026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.86
8.1.230.0100.00317.45
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0050.00517.23
8.1.190.0080.00017.23
8.1.180.0050.00318.10
8.1.170.0050.00318.65
8.1.160.0040.00418.94
8.1.150.0030.00520.70
8.1.140.0060.00319.47
8.1.130.0000.00718.97
8.1.120.0040.00417.45
8.1.110.0070.00017.44
8.1.100.0040.00417.51
8.1.90.0000.00817.44
8.1.80.0000.00717.36
8.1.70.0000.00817.45
8.1.60.0080.00017.49
8.1.50.0040.00417.52
8.1.40.0040.00417.54
8.1.30.0070.00017.75
8.1.20.0000.00817.67
8.1.10.0020.00517.59
8.1.00.0000.00717.41
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0070.00018.50
8.0.270.0040.00417.28
8.0.260.0030.00316.77
8.0.250.0040.00417.01
8.0.240.0020.00516.93
8.0.230.0070.00016.97
8.0.220.0030.00316.99
8.0.210.0070.00017.02
8.0.200.0000.00717.01
8.0.190.0050.00517.00
8.0.180.0060.00316.98
8.0.170.0000.00716.90
8.0.160.0080.00017.08
8.0.150.0000.00716.80
8.0.140.0040.00416.96
8.0.130.0050.00013.34
8.0.120.0030.00516.94
8.0.110.0000.00717.07
8.0.100.0040.00416.96
8.0.90.0040.00416.84
8.0.80.0110.01116.99
8.0.70.0070.00016.83
8.0.60.0000.00716.86
8.0.50.0070.00016.84
8.0.30.0090.00817.08
8.0.20.0120.02117.40
8.0.10.0040.00416.95
8.0.00.0120.00616.73
7.4.330.0000.00615.55
7.4.320.0000.00716.50
7.4.300.0030.00316.50
7.4.290.0030.00516.57
7.4.280.0000.00816.51
7.4.270.0030.00316.52
7.4.260.0030.00313.35
7.4.250.0040.00416.58
7.4.240.0050.00216.54
7.4.230.0030.00316.52
7.4.220.0120.00616.39
7.4.210.0170.00316.47
7.4.200.0040.00416.68
7.4.160.0030.01516.46
7.4.150.0060.01217.40
7.4.140.0070.01217.86
7.4.130.0140.00516.63
7.4.120.0100.01216.47
7.4.110.0070.01416.50
7.4.100.0130.01016.54
7.4.90.0080.00816.55
7.4.80.0130.01019.39
7.4.70.0110.00516.64
7.4.60.0070.00716.56
7.4.50.0030.01016.32
7.4.40.0160.00016.42
7.4.30.0130.00316.51
7.4.00.0030.00914.94
7.3.330.0000.00513.37
7.3.320.0050.00013.40
7.3.310.0000.00816.27
7.3.300.0070.00016.21
7.3.290.0070.00916.33
7.3.280.0090.00716.36
7.3.270.0100.00717.40
7.3.260.0040.01416.37
7.3.250.0120.00716.46
7.3.240.0110.00816.40
7.3.230.0070.01116.36
7.3.210.0060.00916.41
7.3.200.0130.00316.46
7.3.190.0110.00516.61
7.3.180.0130.00716.45
7.3.170.0060.00916.59
7.3.160.0040.01216.45
7.2.330.0090.00916.68
7.2.320.0160.00016.67
7.2.310.0110.01116.72
7.2.300.0120.00616.37
7.2.290.0130.00316.59
7.2.60.0070.00716.87
7.2.00.0270.00319.21
7.1.200.0030.00915.49
7.1.100.0040.00818.06
7.1.70.0180.01415.00
7.1.60.0900.01733.31
7.1.50.0360.01732.98
7.1.40.0250.02132.46
7.1.30.0340.01032.65
7.1.20.0300.01532.57
7.1.10.0230.01314.63
7.1.00.0210.00715.01
7.0.200.0180.01114.96
7.0.190.0090.01414.71
7.0.180.0250.00814.40
7.0.170.0140.01014.50
7.0.160.0210.01714.56
7.0.150.0170.01314.66
7.0.140.0200.00914.50
7.0.130.0190.01514.61
7.0.120.0210.00814.75
7.0.110.0110.01114.60
7.0.100.0090.01714.57
7.0.90.0160.01314.24
7.0.80.0180.01214.45
7.0.70.0090.01814.35
7.0.60.1140.01114.17
7.0.50.0210.00614.55
7.0.40.0140.01014.38
7.0.30.0160.01214.39
7.0.20.0180.01514.60
7.0.10.0250.01014.49
7.0.00.0160.01414.60

preferences:
39.51 ms | 400 KiB | 5 Q