3v4l.org

run code in 300+ PHP versions simultaneously
<?php class arraytest implements arrayaccess { private $container = array(); public function __construct() { $this->container = array( "one" => 1, "two" => 2, "three" => 3, ); } public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } public function offsetExists($offset) { return isset($this->container[$offset]); } public function offsetUnset($offset) { unset($this->container[$offset]); } public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } function bob(array $test) { print_r($test); } $x = new arraytest(); bob($x);

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.0040.01118.68
8.3.50.0140.00616.67
8.3.40.0070.01318.81
8.3.30.0110.00318.79
8.3.20.0050.00318.71
8.3.10.0080.00018.85
8.3.00.0100.00017.63
8.2.180.0130.00725.92
8.2.170.0170.00319.08
8.2.160.0070.01022.96
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00421.11
8.2.110.0170.00322.07
8.2.100.0000.01119.89
8.2.90.0050.00317.63
8.2.80.0000.00818.86
8.2.70.0030.00617.63
8.2.60.0040.00717.80
8.2.50.0000.01018.07
8.2.40.0030.00519.35
8.2.30.0030.00617.76
8.2.20.0000.00917.76
8.2.10.0040.00417.79
8.2.00.0080.00017.71
8.1.280.0090.00925.92
8.1.270.0030.00723.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00718.98
8.1.230.0070.00417.77
8.1.220.0000.00917.78
8.1.210.0000.00818.77
8.1.200.0000.01017.23
8.1.190.0040.00417.23
8.1.180.0000.00918.10
8.1.170.0050.00318.75
8.1.160.0040.00419.07
8.1.150.0000.00818.58
8.1.140.0050.00317.41
8.1.130.0000.00817.52
8.1.120.0060.00317.51
8.1.110.0050.00317.53
8.1.100.0040.00417.51
8.1.90.0080.00017.45
8.1.80.0030.00317.37
8.1.70.0000.00717.50
8.1.60.0060.00317.66
8.1.50.0040.00417.45
8.1.40.0080.00017.44
8.1.30.0060.00317.62
8.1.20.0040.00417.64
8.1.10.0000.00817.50
8.1.00.0050.00317.60
8.0.300.0000.00918.77
8.0.290.0070.00316.75
8.0.280.0000.00718.51
8.0.270.0000.00817.31
8.0.260.0030.00316.96
8.0.250.0040.00416.92
8.0.240.0070.00016.91
8.0.230.0040.00417.02
8.0.220.0070.00016.96
8.0.210.0000.00717.00
8.0.200.0030.00316.90
8.0.190.0030.00316.92
8.0.180.0000.00717.04
8.0.170.0030.00516.95
8.0.160.0000.00717.10
8.0.150.0040.00416.95
8.0.140.0040.00416.94
8.0.130.0060.00013.45
8.0.120.0050.00316.88
8.0.110.0000.00716.97
8.0.100.0040.00416.96
8.0.90.0040.00416.85
8.0.80.0060.00917.00
8.0.70.0040.00417.04
8.0.60.0080.00016.82
8.0.50.0040.00416.91
8.0.30.0030.01317.04
8.0.20.0100.01016.94
8.0.10.0050.00316.98
8.0.00.0130.01216.95
7.4.330.0000.00512.98
7.4.320.0030.00316.63
7.4.300.0060.00016.49
7.4.290.0030.00316.62
7.4.280.0080.00016.42
7.4.270.0000.00816.59
7.4.260.0000.00513.30
7.4.250.0030.00516.51
7.4.240.0040.00416.61
7.4.230.0070.00016.55
7.4.220.0060.02016.58
7.4.210.0100.00916.42
7.4.200.0030.00316.50
7.4.190.0000.00816.58
7.4.160.0090.00616.54
7.4.150.0120.00616.74
7.4.140.0130.00717.86
7.4.130.0190.00616.35
7.4.120.0030.01716.50
7.4.110.0120.00616.45
7.4.100.0000.01816.72
7.4.90.0070.01116.44
7.4.80.0110.00619.39
7.4.70.0150.00616.40
7.4.60.0120.00616.58
7.4.50.0000.00716.62
7.4.40.0140.00416.54
7.4.30.0130.00416.45
7.4.00.0060.01015.08
7.3.330.0070.00013.36
7.3.320.0000.00613.21
7.3.310.0000.00716.41
7.3.300.0070.00016.31
7.3.290.0130.00316.39
7.3.280.0090.00616.35
7.3.270.0150.00316.36
7.3.260.0140.00716.46
7.3.240.0100.00716.57
7.3.230.0100.00716.60
7.3.210.0170.03016.37
7.3.200.0120.00416.54
7.3.190.0100.00916.45
7.3.180.0090.00616.56
7.3.170.0030.01516.47
7.3.160.0070.01016.35
7.3.120.0140.00014.87
7.2.330.0100.00716.55
7.2.320.0000.01616.71
7.2.310.0080.01116.64
7.2.300.0070.01016.61
7.2.290.0070.01016.30
7.2.60.0800.00915.01
7.2.00.0040.00819.24
7.1.200.0060.00615.72
7.1.100.0120.00017.97
7.1.70.0030.00517.19
7.1.60.0120.01219.25
7.1.50.0100.01316.92
7.1.00.0000.06722.36
7.0.200.0000.00816.94
7.0.140.0100.07022.15
7.0.120.0000.07722.15
7.0.60.0070.04019.93
7.0.50.0130.03017.79
7.0.40.0070.08320.40
7.0.30.0130.04320.12
7.0.20.0130.05320.33
7.0.10.0200.07720.24
7.0.00.0100.05320.07
5.6.280.0030.07321.11
5.6.210.0030.04720.52
5.6.200.0100.04718.16
5.6.190.0100.07320.63
5.6.180.0300.06320.52
5.6.170.0270.07320.51
5.6.160.0100.05720.57
5.6.150.0100.05718.18
5.6.140.0130.07318.18
5.6.130.0100.08018.14
5.6.120.0170.07721.21
5.6.110.0230.06321.13
5.6.100.0130.05321.14
5.6.90.0070.08321.14
5.6.80.0030.04020.32
5.5.350.0030.05020.40
5.5.340.0000.04017.94
5.5.330.0100.08320.42
5.5.320.0430.05720.42
5.5.310.0230.07320.34
5.5.300.0130.07017.99
5.5.290.0070.04017.95
5.5.280.0130.04720.74
5.5.270.0100.06320.88
5.5.260.0170.08320.80
5.5.250.0030.04020.67
5.5.240.0170.03320.22
5.4.450.2200.05719.49
5.4.440.1900.04319.19
5.4.430.2100.03719.54
5.4.420.1830.04019.38
5.4.410.1870.03719.36
5.4.400.2170.04719.04
5.4.390.2100.04319.20
5.4.380.2070.04319.19
5.4.370.1970.04319.22
5.4.360.2130.04719.06
5.4.350.2000.04718.84
5.4.340.1870.04018.99
5.4.320.2170.03718.88
5.4.310.2100.04018.98
5.4.300.2230.03719.16
5.4.290.2030.05018.97
5.4.280.1970.04319.09
5.4.270.2100.03719.30
5.4.260.1930.03719.23
5.4.250.0000.06718.97
5.4.240.0000.08019.13
5.4.230.0930.06719.18
5.4.220.2200.04318.94
5.4.210.1900.03019.01
5.4.200.2030.04319.23
5.4.190.2030.04718.96
5.4.180.1970.04719.16
5.4.170.2100.03318.97
5.4.160.1970.04718.96
5.4.150.2000.03718.82
5.4.140.2070.04316.56
5.4.130.0700.04316.46
5.4.120.0000.06316.39
5.4.110.0030.07316.49
5.4.100.1730.03316.63
5.4.90.2130.04316.61
5.4.80.2170.03716.61
5.4.70.1830.03716.59
5.4.60.1900.03016.43
5.4.50.2030.04316.24
5.4.40.1970.03316.55
5.4.30.1800.03316.47
5.4.20.1970.03016.50
5.4.10.2130.04316.42
5.4.00.0870.03715.95
5.3.290.0070.04014.59
5.3.280.0070.03714.68
5.3.270.1970.03714.51
5.3.260.1830.03314.53
5.3.250.1900.03314.84
5.3.240.2200.04014.59
5.3.230.1900.04014.72
5.3.220.2000.03014.48
5.3.210.2370.03314.67
5.3.200.1900.03014.59
5.3.190.2030.04014.69
5.3.180.2100.04014.45
5.3.170.0700.04314.48
5.3.160.0030.04314.65
5.3.150.0070.03714.49
5.3.140.1770.03014.57
5.3.130.2070.03714.46
5.3.120.1800.03314.54
5.3.110.1630.04014.53
5.3.100.2130.04013.95
5.3.90.2000.04314.14
5.3.80.2130.04014.05
5.3.70.2100.03714.09
5.3.60.1900.04713.99
5.3.50.1800.03313.89
5.3.40.1400.04013.89
5.3.30.0000.03713.97
5.3.20.0000.03713.93
5.3.10.1270.03013.82
5.3.00.2070.03313.80
5.2.170.0030.03311.09
5.2.160.0000.03711.09
5.2.150.0000.03711.27
5.2.140.1170.02711.08
5.2.130.1600.02711.04
5.2.120.1430.02711.23
5.2.110.1600.02311.26
5.2.100.1600.02711.04
5.2.90.1600.03711.16
5.2.80.1830.03311.00
5.2.70.1670.03011.03
5.2.60.1830.03311.21
5.2.50.1100.02711.11
5.2.40.0030.03011.24
5.2.30.0030.02711.21
5.2.20.0000.03010.90
5.2.10.0500.02710.77
5.2.00.1470.03010.89
5.1.60.1470.0279.96
5.1.50.1430.0279.90
5.1.40.1270.0209.98
5.1.30.1270.02310.34
5.1.20.1270.02710.37
5.1.10.1500.02710.03
5.1.00.1400.03310.13
5.0.50.0730.0278.62
5.0.40.0500.0238.35
5.0.30.0670.0278.22
5.0.20.0630.0278.14
5.0.10.0800.0338.26
5.0.00.0700.0278.05
4.4.90.0800.0107.68
4.4.80.0730.0177.68
4.4.70.0700.0207.68
4.4.60.0000.0177.68
4.4.50.0000.0177.68
4.4.40.0000.0437.68
4.4.30.0030.0137.68
4.4.20.0030.0177.68
4.4.10.0000.0177.68
4.4.00.0030.0507.68
4.3.110.0200.0137.68
4.3.100.0630.0137.68
4.3.90.0770.0207.68
4.3.80.0630.0237.68
4.3.70.0600.0177.68
4.3.60.0700.0177.68
4.3.50.0830.0237.68
4.3.40.0000.0277.68
4.3.30.0030.0137.68
4.3.20.0030.0277.68
4.3.10.0070.0177.68
4.3.00.0000.0137.68

preferences:
43.2 ms | 400 KiB | 5 Q