3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function __toString() { return "bar";}} class obj implements ArrayAccess { private $container = array(); public function __construct() { $this->container = array( "one" => 1, "two" => 2, "three" => 3, ); } public function offsetSet($offset, $value) { var_dump($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) { var_dump($offset); return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $a = new obj; $a[] += 12; var_dump($a);

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.01218.39
8.3.50.0180.01122.05
8.3.40.0070.00718.79
8.3.30.0000.01419.01
8.3.20.0040.00420.21
8.3.10.0080.00023.66
8.3.00.0080.00019.38
8.2.180.0000.01518.29
8.2.170.0070.00722.96
8.2.160.0110.00420.16
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00022.08
8.2.110.0000.00920.82
8.2.100.0110.00017.63
8.2.90.0040.00419.25
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0000.00818.04
8.2.50.0060.00318.07
8.2.40.0040.00418.05
8.2.30.0040.00418.27
8.2.20.0050.00317.66
8.2.10.0000.00818.11
8.2.00.0000.00817.72
8.1.280.0120.00925.92
8.1.270.0000.00922.19
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00323.83
8.1.230.0090.00618.85
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0070.00317.35
8.1.190.0000.00817.13
8.1.180.0070.00018.10
8.1.170.0040.00420.36
8.1.160.0040.00422.02
8.1.150.0070.00018.90
8.1.140.0000.00717.45
8.1.130.0000.00717.76
8.1.120.0000.00717.43
8.1.110.0050.00217.50
8.1.100.0040.00317.41
8.1.90.0000.00717.48
8.1.80.0000.00717.36
8.1.70.0000.00717.35
8.1.60.0000.01317.64
8.1.50.0040.00417.39
8.1.40.0040.00417.50
8.1.30.0090.00017.56
8.1.20.0030.00617.65
8.1.10.0040.00417.51
8.1.00.0000.00817.48
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0040.00418.45
8.0.270.0030.00317.27
8.0.260.0000.00617.33
8.0.250.0000.00716.96
8.0.240.0000.00716.83
8.0.230.0030.00316.92
8.0.220.0040.00416.81
8.0.210.0060.00016.95
8.0.200.0040.00416.88
8.0.190.0000.00716.95
8.0.180.0040.00416.82
8.0.170.0000.00717.00
8.0.160.0000.00816.97
8.0.150.0030.00416.71
8.0.140.0040.00416.85
8.0.130.0030.00313.32
8.0.120.0040.00416.85
8.0.110.0030.00516.82
8.0.100.0000.00816.70
8.0.90.0040.00416.86
8.0.80.0110.00916.92
8.0.70.0000.00716.94
8.0.60.0040.00416.92
8.0.50.0040.00416.70
8.0.30.0090.01417.08
8.0.20.0100.00917.40
8.0.10.0040.00416.82
8.0.00.0060.01116.87
7.4.330.0030.00315.02
7.4.320.0000.00616.45
7.4.300.0060.00016.60
7.4.290.0040.00416.50
7.4.280.0000.00716.65
7.4.270.0020.00516.45
7.4.260.0030.00316.48
7.4.250.0000.00716.59
7.4.240.0020.00516.60
7.4.230.0000.00716.52
7.4.220.0030.01416.62
7.4.210.0100.01016.55
7.4.200.0000.00816.51
7.4.160.0090.00616.50
7.4.150.0090.01317.40
7.4.140.0050.01317.86
7.4.130.0130.00916.62
7.4.120.0130.00516.51
7.4.110.0100.01316.57
7.4.100.0110.00716.39
7.4.90.0110.00616.68
7.4.80.0090.00919.39
7.4.70.0170.00416.42
7.4.60.0090.01516.41
7.4.50.0000.00816.40
7.4.40.0070.01016.67
7.4.30.0140.00416.38
7.4.00.0040.01114.88
7.3.330.0000.00513.37
7.3.320.0000.00513.30
7.3.310.0070.00016.16
7.3.300.0040.00416.34
7.3.290.0070.01016.27
7.3.280.0090.01016.29
7.3.270.0140.00717.40
7.3.260.0100.01016.30
7.3.250.0160.00716.52
7.3.240.0130.01016.30
7.3.230.0030.01416.39
7.3.210.0040.01316.40
7.3.200.0070.01019.39
7.3.190.0190.00016.34
7.3.180.0100.00616.25
7.3.170.0130.00716.44
7.3.160.0140.00716.34
7.2.330.0080.01216.57
7.2.320.0050.01116.74
7.2.310.0090.00916.73
7.2.300.0110.00716.44
7.2.290.0150.01116.59
7.2.60.0030.00616.94
7.2.00.0000.01419.59
7.1.200.0110.00015.63
7.1.100.0080.00818.18
7.1.70.0040.00417.02
7.1.60.0070.01719.32
7.1.50.0300.00334.82
7.1.00.0100.07022.44
7.0.200.0000.00816.73
7.0.140.0070.06722.09
7.0.60.0100.08020.01
7.0.50.0100.07317.86
7.0.40.0200.07020.05
7.0.30.0230.04020.33
7.0.20.0330.06320.34
7.0.10.0100.04320.05
7.0.00.0100.08320.33
5.6.280.0130.06720.93
5.6.210.0130.07020.73
5.6.200.0030.06018.29
5.6.190.0030.05720.47
5.6.180.0230.05720.41
5.6.170.0430.04020.55
5.6.160.0000.04320.39
5.6.150.0070.05018.15
5.6.140.0070.08018.18
5.6.130.0170.06018.23
5.6.120.0130.07721.00
5.6.110.0030.04021.02
5.6.100.0130.08021.13
5.6.90.0230.06321.11
5.6.80.0030.08020.36
5.6.70.4570.03720.42
5.5.350.0370.07320.34
5.5.340.0030.08318.08
5.5.330.0100.06320.19
5.5.320.0300.07320.35
5.5.310.0270.04320.34
5.5.300.0070.07018.05
5.5.290.0070.06018.04
5.5.280.0070.08320.66
5.5.270.0070.06720.85
5.5.260.0070.08320.74
5.5.250.0070.07020.72
5.5.240.0270.07020.29
5.4.450.0070.04019.55
5.4.440.0130.04319.55
5.4.430.0130.04319.28
5.4.420.0100.03719.27
5.4.410.0130.04019.29
5.4.400.0230.03319.07
5.4.390.0170.07019.21
5.4.380.0170.03318.86
5.4.370.0130.03319.22
5.4.360.0130.03719.13
5.4.350.0170.06018.95
5.4.340.0130.03319.25
5.4.320.0130.03319.05
5.4.310.0100.04319.16
5.4.300.0230.03718.91
5.4.290.0100.03319.15
5.4.280.0170.07319.26
5.4.270.0200.05018.98
5.4.260.0130.06319.30
5.4.250.0200.05719.17
5.4.240.0200.07019.08
5.4.230.0070.06019.19
5.4.220.0230.06018.97
5.4.210.0200.06319.07
5.4.200.0200.06319.15
5.4.190.0270.07319.30
5.4.180.0170.07319.30
5.4.170.0130.05018.98
5.4.160.0300.03719.22
5.4.150.0130.05019.15
5.4.140.0130.06316.32
5.4.130.0200.07016.33
5.4.120.0130.06016.28
5.4.110.0130.07316.25
5.4.100.0170.06316.40
5.4.90.0100.04016.35
5.4.80.0130.04316.44
5.4.70.0130.04316.25
5.4.60.0070.07016.32
5.4.50.0170.04316.52
5.4.40.0170.07016.53
5.4.30.0170.06316.23
5.4.20.0200.06716.53
5.4.10.0130.07016.37
5.4.00.0200.06715.73
5.3.290.0170.03315.05
5.3.280.0200.05015.05
5.3.270.0230.04715.05
5.3.260.0200.04315.05
5.3.250.0100.04015.05
5.3.240.0230.05015.05
5.3.230.0170.07715.05
5.3.220.0300.06315.05
5.3.210.0200.07715.05
5.3.200.0200.07015.05
5.3.190.0170.07315.05
5.3.180.0200.03715.05
5.3.170.0100.04715.05
5.3.160.0130.04015.05
5.3.150.0170.06715.05
5.3.140.0170.07715.05
5.3.130.0100.07715.05
5.3.120.0100.04715.05
5.3.110.0070.07015.05
5.3.100.0130.07315.05
5.3.90.0130.07015.05
5.3.80.0100.06715.05
5.3.70.0100.04315.05
5.3.60.0030.07715.05
5.3.50.0100.03715.05
5.3.40.0130.04715.05
5.3.30.0130.05315.05
5.3.20.0130.06315.05
5.3.10.0170.07315.05
5.3.00.0100.07715.05
5.2.170.0000.07315.05
5.2.160.0100.06015.05
5.2.150.0100.04715.05
5.2.140.0100.05315.05
5.2.130.0200.05715.05
5.2.120.0200.06315.05
5.2.110.0070.06015.05
5.2.100.0130.05715.05
5.2.90.0130.05715.05
5.2.80.0200.05315.05
5.2.70.0130.06015.05
5.2.60.0170.05015.05
5.2.50.0230.05315.05
5.2.40.0170.03315.05
5.2.30.0100.05015.05
5.2.20.0130.05715.05
5.2.10.0130.05315.05
5.2.00.0170.05015.05
5.1.60.0100.04715.05
5.1.50.0070.02715.05
5.1.40.0000.05015.05
5.1.30.0070.05315.05
5.1.20.0070.04715.05
5.1.10.0100.04315.05
5.1.00.0070.03715.05
5.0.50.0030.04015.05
5.0.40.0070.04715.05
5.0.30.0000.05715.05
5.0.20.0170.03015.05
5.0.10.0100.02315.05
5.0.00.0030.06315.05
4.4.90.0100.03015.05
4.4.80.0030.01715.05
4.4.70.0100.02315.05
4.4.60.0030.03015.05
4.4.50.0000.03715.05
4.4.40.0000.05015.05
4.4.30.0070.02715.05
4.4.20.0000.03715.05
4.4.10.0000.03715.05
4.4.00.0000.04015.05
4.3.110.0030.03315.05
4.3.100.0030.02315.05
4.3.90.0000.03315.05
4.3.80.0000.03715.05
4.3.70.0000.03715.05
4.3.60.0000.03015.05
4.3.50.0000.03315.05
4.3.40.0030.04715.05
4.3.30.0030.03315.05
4.3.20.0030.03715.05
4.3.10.0070.02715.05
4.3.00.0000.02315.05

preferences:
54.61 ms | 401 KiB | 5 Q