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('set', $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('get', $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.0110.00718.56
8.3.50.0090.01021.91
8.3.40.0040.01118.85
8.3.30.0070.00719.10
8.3.20.0040.00420.46
8.3.10.0040.00423.43
8.3.00.0050.00319.50
8.2.180.0090.00616.75
8.2.170.0140.00722.96
8.2.160.0110.00320.52
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0000.00822.27
8.2.110.0000.00922.20
8.2.100.0090.00317.75
8.2.90.0030.00618.94
8.2.80.0040.00417.97
8.2.70.0040.00417.38
8.2.60.0000.00817.80
8.2.50.0080.00018.07
8.2.40.0040.00418.28
8.2.30.0000.00718.01
8.2.20.0080.00017.63
8.2.10.0040.00418.12
8.2.00.0040.00417.73
8.1.280.0100.01025.92
8.1.270.0090.00023.86
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.92
8.1.230.0080.00319.01
8.1.220.0060.00317.78
8.1.210.0000.00918.77
8.1.200.0080.00417.35
8.1.190.0000.00817.25
8.1.180.0030.00618.10
8.1.170.0040.00420.26
8.1.160.0000.00722.02
8.1.150.0040.00418.89
8.1.140.0060.00317.37
8.1.130.0000.00717.83
8.1.120.0040.00417.48
8.1.110.0000.00717.50
8.1.100.0000.00717.45
8.1.90.0040.00417.46
8.1.80.0000.00717.48
8.1.70.0000.00717.44
8.1.60.0080.00317.62
8.1.50.0050.00317.56
8.1.40.0000.00817.40
8.1.30.0000.00917.68
8.1.20.0000.00817.63
8.1.10.0060.00317.50
8.1.00.0000.00717.43
8.0.300.0000.00718.77
8.0.290.0060.00316.75
8.0.280.0000.00718.41
8.0.270.0050.00217.26
8.0.260.0000.00817.23
8.0.250.0000.00716.87
8.0.240.0030.00516.96
8.0.230.0030.00316.90
8.0.220.0070.00016.89
8.0.210.0030.00316.78
8.0.200.0030.00316.88
8.0.190.0050.00316.94
8.0.180.0040.00416.89
8.0.170.0000.00816.91
8.0.160.0000.00716.86
8.0.150.0070.00016.91
8.0.140.0070.00016.81
8.0.130.0050.00013.36
8.0.120.0000.00716.91
8.0.110.0000.00716.93
8.0.100.0070.00016.94
8.0.90.0030.00516.77
8.0.80.0100.00716.89
8.0.70.0000.00716.94
8.0.60.0040.00416.92
8.0.50.0050.00216.84
8.0.30.0090.01017.23
8.0.20.0110.00917.40
8.0.10.0040.00416.96
8.0.00.0090.01216.89
7.4.330.0000.00715.02
7.4.320.0030.00316.59
7.4.300.0000.00716.51
7.4.290.0000.00716.51
7.4.280.0080.00016.63
7.4.270.0030.00316.63
7.4.260.0040.00416.49
7.4.250.0000.00716.48
7.4.240.0030.00416.46
7.4.230.0000.00616.61
7.4.220.0100.00716.72
7.4.210.0080.00816.56
7.4.200.0030.00316.63
7.4.160.0050.01116.63
7.4.150.0130.00617.40
7.4.140.0130.00817.86
7.4.130.0120.00716.59
7.4.120.0150.00216.38
7.4.110.0030.02016.36
7.4.100.0130.01016.29
7.4.90.0130.00416.43
7.4.80.0090.00919.39
7.4.70.0130.01016.45
7.4.60.0070.01016.59
7.4.50.0040.00416.37
7.4.40.0090.00816.55
7.4.30.0100.00716.44
7.4.00.0070.01015.07
7.3.330.0000.00613.17
7.3.320.0050.00013.27
7.3.310.0070.00016.25
7.3.300.0030.00316.17
7.3.290.0040.01016.30
7.3.280.0090.00816.35
7.3.270.0080.01617.40
7.3.260.0080.00816.52
7.3.250.0120.00516.54
7.3.240.0130.00516.55
7.3.230.0130.01016.43
7.3.210.0070.01016.39
7.3.200.0060.01019.39
7.3.190.0090.01316.53
7.3.180.0080.00816.53
7.3.170.0130.00316.52
7.3.160.0150.00316.30
7.2.330.0060.01216.52
7.2.320.0100.00716.83
7.2.310.0120.00416.84
7.2.300.0030.01716.78
7.2.290.0080.01616.48
7.2.60.0030.01016.97
7.2.00.0090.00619.19
7.1.200.0040.01116.03
7.1.100.0000.01118.08
7.1.70.0030.00717.11
7.1.60.0070.01719.32
7.1.50.0090.00916.96
7.1.00.0070.07322.35
7.0.200.0030.00516.88
7.0.140.0030.07321.98
7.0.60.0100.07319.80
7.0.50.0070.03717.86
7.0.40.0070.08320.26
7.0.30.0330.07320.20
7.0.20.0500.06320.07
7.0.10.0130.07320.10
7.0.00.0030.04320.12
5.6.280.0000.07721.03
5.6.210.0100.03320.56
5.6.200.0030.07018.23
5.6.190.0100.05020.59
5.6.180.0270.06720.61
5.6.170.0330.07020.57
5.6.160.0030.05020.43
5.6.150.0030.04018.17
5.6.140.0100.06318.27
5.6.130.0100.04018.18
5.6.120.0300.03721.13
5.6.110.0030.04321.14
5.6.100.0100.05021.10
5.6.90.0030.08720.88
5.6.80.0030.08320.39
5.6.70.3270.03720.43
5.5.350.0330.07720.54
5.5.340.0030.06018.04
5.5.330.0200.07020.41
5.5.320.0270.04720.44
5.5.310.0200.05320.27
5.5.300.0170.06317.97
5.5.290.0000.05317.98
5.5.280.0070.09020.88
5.5.270.0070.07020.85
5.5.260.0130.07720.68
5.5.250.0070.04020.66
5.5.240.0130.04020.27
5.4.450.0070.06319.59
5.4.440.0630.06719.34
5.4.430.0270.05319.47
5.4.420.0930.04319.60
5.4.410.0030.06019.35
5.4.400.0730.06018.98
5.4.390.0970.05019.16
5.4.380.0900.05018.83
5.4.370.0630.06019.23
5.4.360.0770.06018.84
5.4.350.0870.05318.87
5.4.340.0070.03212.02
5.4.320.0020.04012.51
5.4.310.0070.03612.51
5.4.300.0050.03612.51
5.4.290.0040.03912.50
5.4.280.0070.03412.40
5.4.270.0080.03712.40
5.4.260.0060.03812.40
5.4.250.0050.04212.41
5.4.240.0030.04112.40
5.4.230.0070.03612.39
5.4.220.0050.03612.40
5.4.210.0050.03612.40
5.4.200.0050.03812.39
5.4.190.0090.03212.39
5.4.180.0080.04112.39
5.4.170.0060.03712.41
5.4.160.0030.03812.40
5.4.150.0070.03512.39
5.4.140.0050.03812.07
5.4.130.0040.03612.06
5.4.120.0080.03412.02
5.4.110.0040.03712.02
5.4.100.0060.03912.02
5.4.90.0030.03912.02
5.4.80.0060.04312.02
5.4.70.0050.03612.02
5.4.60.0040.03612.02
5.4.50.0110.03112.01
5.4.40.0090.03212.01
5.4.30.0040.03712.00
5.4.20.0060.04012.00
5.4.10.0070.03412.00
5.4.00.0040.03811.49
5.3.290.0070.03812.80
5.3.280.0080.03812.71
5.3.270.0080.03812.73
5.3.260.0070.03912.72
5.3.250.0060.03712.72
5.3.240.0090.03612.72
5.3.230.0070.03612.71
5.3.220.0080.03512.68
5.3.210.0080.03712.68
5.3.200.0090.03312.68
5.3.190.0060.03912.68
5.3.180.0030.03812.68
5.3.170.0080.03612.67
5.3.160.0050.03712.67
5.3.150.0070.03612.68
5.3.140.0070.03512.66
5.3.130.0090.03512.66
5.3.120.0090.03412.66
5.3.110.0040.03912.66
5.3.100.0060.03512.13
5.3.90.0070.03512.11
5.3.80.0080.03312.10
5.3.70.0040.03712.10
5.3.60.0050.03612.09
5.3.50.0030.03812.04
5.3.40.0060.03512.03
5.3.30.0050.03511.99
5.3.20.0050.03511.77
5.3.10.0060.03511.74
5.3.00.0050.03511.73
5.2.170.0040.0309.23
5.2.160.0050.0279.23
5.2.150.0030.0319.23
5.2.140.0040.0309.22
5.2.130.0040.0299.18
5.2.120.0040.0289.18
5.2.110.0020.0319.19
5.2.100.0030.0309.19
5.2.90.0060.0279.19
5.2.80.0060.0309.18
5.2.70.0050.0319.18
5.2.60.0020.0329.14
5.2.50.0050.0299.11
5.2.40.0050.0279.08
5.2.30.0050.0309.06
5.2.20.0060.0359.05
5.2.10.0050.0278.96
5.2.00.0040.0298.82
5.1.60.0030.0248.10
5.1.50.0070.0308.09
5.1.40.0030.0258.07
5.1.30.0060.0268.42
5.1.20.0100.0228.45
5.1.10.0020.0278.18
5.1.00.0040.0318.18
5.0.50.0050.0206.65
5.0.40.0030.0226.52
5.0.30.0040.0336.32
5.0.20.0030.0236.29
5.0.10.0080.0166.27
5.0.00.0040.0306.21
4.4.90.0030.0154.78
4.4.80.0040.0154.76
4.4.70.0020.0164.75
4.4.60.0010.0214.76
4.4.50.0020.0154.77
4.4.40.0030.0244.71
4.4.30.0020.0154.76
4.4.20.0030.0194.84
4.4.10.0030.0154.85
4.4.00.0010.0264.76
4.3.110.0010.0174.67
4.3.100.0030.0154.66
4.3.90.0040.0134.64
4.3.80.0060.0234.59
4.3.70.0020.0204.63
4.3.60.0030.0184.63
4.3.50.0040.0184.62
4.3.40.0030.0274.54
4.3.30.0010.0163.30
4.3.20.0030.0143.28
4.3.10.0020.0163.24
4.3.00.0100.0236.99

preferences:
43.22 ms | 400 KiB | 5 Q