3v4l.org

run code in 300+ PHP versions simultaneously
<?php use ArrayObject as PhpArrayObject; class Parameters extends PhpArrayObject { /** * Constructor * * Enforces that we have an array, and enforces parameter access to array * elements. * * @param array $values */ public function __construct(array $values = null) { if (null === $values) { $values = []; } parent::__construct($values, ArrayObject::ARRAY_AS_PROPS); } /** * Populate from native PHP array * * @param array $values * @return void */ public function fromArray(array $values) { $this->exchangeArray($values); } /** * Populate from query string * * @param string $string * @return void */ public function fromString($string) { $array = []; parse_str($string, $array); $this->fromArray($array); } /** * Serialize to native PHP array * * @return array */ public function toArray() { return $this->getArrayCopy(); } /** * Serialize to query string * * @return string */ public function toString() { return http_build_query($this->toArray()); } /** * Retrieve by key * * Returns null if the key does not exist. * * @param string $name * @return mixed */ public function offsetGet($name) { if ($this->offsetExists($name)) { return parent::offsetGet($name); } return; } /** * @param string $name * @param mixed $default optional default value * @return mixed */ public function get($name, $default = null) { if ($this->offsetExists($name)) { return parent::offsetGet($name); } return $default; } /** * @param string $name * @param mixed $value * @return Parameters */ public function set($name, $value) { $this[$name] = $value; return $this; } } $data = new Parameters(); $data->param['toto'] = 'tutu'; $data->param['type'] = 1; var_dump($data);

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.0100.01318.56
8.3.50.0060.01118.43
8.3.40.0040.01118.56
8.3.30.0130.00618.96
8.3.20.0050.00320.29
8.3.10.0000.00821.86
8.3.00.0050.00321.90
8.2.180.0040.01118.17
8.2.170.0140.00022.96
8.2.160.0000.02021.14
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00022.15
8.2.120.0060.00326.35
8.2.110.0090.00022.36
8.2.100.0080.00318.03
8.2.90.0030.00619.64
8.2.80.0000.00817.97
8.2.70.0060.00318.05
8.2.60.0000.00817.96
8.2.50.0030.00518.10
8.2.40.0040.00420.62
8.2.30.0080.00019.32
8.2.20.0000.00818.01
8.2.10.0000.00718.15
8.2.00.0040.00418.19
8.1.280.0070.01425.92
8.1.270.0000.00820.69
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0000.00922.05
8.1.230.0040.00820.86
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.22
8.1.190.0060.00317.22
8.1.180.0030.00518.10
8.1.170.0000.00818.48
8.1.160.0050.00318.80
8.1.150.0070.00020.10
8.1.140.0030.00619.55
8.1.130.0050.00318.94
8.1.120.0030.00417.31
8.1.110.0040.00417.39
8.1.100.0030.00517.40
8.1.90.0000.00917.44
8.1.80.0000.00717.41
8.1.70.0000.00717.38
8.1.60.0030.00617.52
8.1.50.0080.00317.41
8.1.40.0060.00317.54
8.1.30.0070.00417.71
8.1.20.0040.00417.49
8.1.10.0050.00217.48
8.1.00.0040.00417.46
8.0.300.0070.00019.66
8.0.290.0050.00316.63
8.0.280.0080.00018.51
8.0.270.0040.00417.25
8.0.260.0030.00319.08
8.0.250.0000.00716.88
8.0.240.0000.00816.92
8.0.230.0040.00416.91
8.0.220.0040.00416.89
8.0.210.0000.00716.76
8.0.200.0000.00616.80
8.0.190.0040.00416.79
8.0.180.0070.00016.75
8.0.170.0070.00016.88
8.0.160.0040.00416.90
8.0.150.0040.00416.74
8.0.140.0050.00316.83
8.0.130.0000.00513.22
8.0.120.0080.00016.70
8.0.110.0040.00416.84
8.0.100.0030.00516.64
8.0.90.0040.00416.85
8.0.80.0060.00916.73
8.0.70.0030.00516.96
8.0.60.0070.00016.86
8.0.50.0040.00316.91
8.0.30.0070.01217.07
8.0.20.0140.00817.40
8.0.10.0000.00717.03
8.0.00.0070.01016.79
7.4.330.0020.00215.55
7.4.320.0040.00416.44
7.4.300.0070.00016.59
7.4.290.0030.00316.51
7.4.280.0000.00716.41
7.4.270.0030.00316.63
7.4.260.0030.00316.49
7.4.250.0070.00016.37
7.4.240.0040.00416.57
7.4.230.0000.00716.50
7.4.220.0080.00816.64
7.4.210.0090.01016.49
7.4.200.0000.00716.51
7.4.160.0120.00416.56
7.4.150.0030.01417.40
7.4.140.0120.00617.86
7.4.130.0070.01016.59
7.4.120.0070.01316.42
7.4.110.0090.00916.48
7.4.100.0140.00316.55
7.4.90.0080.00816.51
7.4.80.0180.00019.39
7.4.70.0100.00616.43
7.4.60.0080.01216.28
7.4.50.0110.00716.59
7.4.40.0070.01016.43
7.4.30.0100.00616.40
7.4.00.0070.01014.90
7.3.330.0030.00313.36
7.3.320.0050.00013.25
7.3.310.0030.00316.44
7.3.300.0020.00516.39
7.3.290.0110.00516.32
7.3.280.0110.00616.38
7.3.270.0040.01317.40
7.3.260.0090.01116.44
7.3.250.0080.00816.50
7.3.240.0050.01216.47
7.3.230.0080.00816.66
7.3.210.0000.01616.74
7.3.200.0100.00616.33
7.3.190.0130.00316.49
7.3.180.0140.00316.56
7.3.170.0090.00616.50
7.3.160.0120.00916.29
7.3.120.0060.01014.60
7.3.110.0040.01515.09
7.3.100.0040.01114.82
7.3.90.0040.01114.52
7.3.80.0110.00414.80
7.3.70.0100.00715.06
7.3.60.0030.01015.02
7.3.50.0120.00414.99
7.3.40.0060.00314.93
7.3.30.0070.01014.81
7.3.20.0030.01316.40
7.3.10.0060.00616.52
7.3.00.0070.00716.68
7.2.330.0070.01016.55
7.2.320.0030.01516.67
7.2.310.0120.00916.60
7.2.300.0090.00916.38
7.2.290.0090.00916.51
7.2.250.0070.01115.12
7.2.240.0040.01515.20
7.2.230.0060.01214.78
7.2.220.0030.01514.91
7.2.210.0040.01515.07
7.2.200.0080.00615.00
7.2.190.0090.00614.95
7.2.180.0030.01315.23
7.2.170.0000.01414.90
7.2.60.0060.00916.75
7.2.40.1060.01117.66
7.2.30.0890.01017.96
7.2.20.0850.01217.92
7.2.10.0850.00917.97
7.2.00.0690.01217.65
7.1.330.0030.01015.67
7.1.320.0130.00715.75
7.1.310.0100.00615.95
7.1.300.0060.00615.86
7.1.290.0070.00315.58
7.1.280.0080.00415.67
7.1.270.0070.00715.86
7.1.260.0000.01315.74
7.1.200.0030.01015.79
7.1.160.0160.00916.73
7.1.150.1180.01016.86
7.1.140.0870.00716.68
7.1.130.0820.01116.95
7.1.120.0700.01017.04
7.1.110.0660.00816.35
7.1.100.0680.00916.02
7.1.90.1000.00516.08
7.1.80.0800.00816.39
7.1.70.0250.00616.33
7.1.60.0510.00825.17
7.1.50.0420.01824.74
7.1.40.0270.01633.76
7.1.30.0380.01333.46
7.1.20.0330.01733.63
7.1.10.1640.00915.78
7.1.00.0190.00815.70
7.0.290.1180.00916.61
7.0.270.0740.01116.61
7.0.260.0670.00916.51
7.0.250.0630.00815.89
7.0.240.0600.00816.04
7.0.230.0880.00915.94
7.0.220.0890.00815.82
7.0.210.0490.00814.82
7.0.200.0320.01115.72
7.0.190.0410.00814.82
7.0.180.0210.00915.29
7.0.170.0280.01115.35
7.0.160.0170.01015.44
7.0.150.0200.00715.45
7.0.140.0160.01015.42
7.0.130.0130.01215.37
7.0.120.0180.00915.44
7.0.110.0130.01315.36
7.0.100.0160.00915.35
7.0.90.0150.01115.44
7.0.80.0190.00515.55
7.0.70.0160.00815.34
7.0.60.0160.00715.31
7.0.50.0150.01115.33
7.0.40.0110.00815.77
7.0.30.0140.00815.47
7.0.20.0140.00915.38
7.0.10.0150.01115.52
7.0.00.0170.01115.36
5.6.300.0090.06420.77
5.6.290.0120.06020.67
5.6.280.0130.07020.88
5.6.270.0150.05620.89
5.6.260.0140.05820.89
5.6.250.0150.05920.81
5.6.240.0180.05720.79
5.6.230.0090.06720.78
5.6.220.0100.06720.78
5.6.210.0170.07320.74
5.6.200.0170.06620.78
5.6.190.0160.05720.73
5.6.180.0120.06620.83
5.6.170.0180.07020.77
5.6.160.0100.07520.82
5.6.150.0100.07320.70
5.6.140.0150.06220.79
5.6.130.0110.06120.89
5.6.120.0180.06720.76
5.6.110.0130.06020.80
5.6.100.0190.05920.88
5.6.90.0160.06520.65
5.6.80.0130.05220.26
5.6.70.0110.05420.18
5.6.60.0080.06420.12
5.6.50.0140.05020.21
5.6.40.0140.05420.05
5.6.30.0130.05620.03
5.6.20.0180.06020.05
5.6.10.0130.05120.03
5.6.00.0100.05720.00
5.5.380.0150.05617.51
5.5.370.0170.05117.43
5.5.360.0140.05717.47
5.5.350.0220.05017.43
5.5.340.0230.04817.94
5.5.330.0190.05317.97
5.5.320.0130.05617.94
5.5.310.0190.05018.03
5.5.300.0240.04617.79
5.5.290.0140.06018.05
5.5.280.0130.06517.94
5.5.270.0110.06118.02
5.5.260.0130.05917.95
5.5.250.0160.07117.55
5.5.240.0220.05217.38
5.5.230.0100.06017.41
5.5.220.0170.06617.42
5.5.210.0130.05217.32
5.5.200.0110.05617.13
5.5.190.0100.05817.05
5.5.180.0140.05817.35
5.5.160.0100.05517.05
5.5.150.0130.05317.35
5.5.140.0140.05217.46
5.5.130.0120.05617.29
5.5.120.0180.04817.48
5.5.110.0150.05217.29
5.5.100.0140.05317.03
5.5.90.0170.05217.38
5.5.80.0120.05517.36
5.5.70.0120.05617.27
5.5.60.0150.04917.36
5.5.50.0170.05017.04
5.5.40.0160.04917.24
5.5.30.0170.04816.98
5.5.20.0170.05316.98
5.5.10.0170.07617.35
5.5.00.0210.04617.02
5.4.450.0180.06119.38
5.4.440.0250.06319.39
5.4.430.0190.05919.30
5.4.420.0150.05319.35
5.4.410.0150.05219.43
5.4.400.0130.05318.98
5.4.390.0130.07619.01
5.4.380.0180.04918.96
5.4.370.0130.05418.98
5.4.360.0100.05719.04
5.4.350.0090.05618.91
5.4.340.0150.05219.13
5.4.320.0150.05519.07
5.4.310.0170.05319.03
5.4.300.0180.05019.22
5.4.290.0200.04919.13
5.4.280.0120.06918.82
5.4.270.0130.05819.00
5.4.260.0170.04819.00
5.4.250.0160.05618.98
5.4.240.0140.05419.08
5.4.230.0200.06619.14
5.4.220.0130.05518.98
5.4.210.0180.05018.95
5.4.200.0150.05119.13
5.4.190.0140.05318.94
5.4.180.0200.06518.82
5.4.170.0150.05418.84
5.4.160.0160.04918.83
5.4.150.0160.05318.97
5.4.140.0200.05016.40
5.4.130.0120.05016.40
5.4.120.0150.04816.54
5.4.110.0140.05216.65
5.4.100.0190.04716.42
5.4.90.0170.04716.38
5.4.80.0160.04816.46
5.4.70.0150.06416.71
5.4.60.0090.05216.66
5.4.50.0200.05916.48
5.4.40.0210.05116.60
5.4.30.0090.05216.39
5.4.20.0140.04816.66
5.4.10.0110.05416.39
5.4.00.0150.05015.88
5.3.290.0150.05514.86
5.3.280.0180.05514.88
5.3.270.0230.06614.73
5.3.260.0170.04814.66
5.3.250.0160.05014.63
5.3.240.0230.05114.66
5.3.230.0110.05514.86
5.3.220.0200.06714.62
5.3.210.0140.05614.84
5.3.200.0200.05114.74
5.3.190.0150.05614.85
5.3.180.0190.05314.63
5.3.170.0190.04914.75
5.3.160.0180.04914.61
5.3.150.0160.05814.68
5.3.140.0100.05214.75
5.3.130.0160.05014.85
5.3.120.0170.04814.61
5.3.110.0170.05314.80
5.3.100.0110.05514.16
5.3.90.0180.04613.89
5.3.80.0140.04714.09
5.3.70.0080.05214.08
5.3.60.0170.04514.18
5.3.50.0150.04913.91
5.3.40.0120.06714.21
5.3.30.0220.05913.96
5.3.20.0150.04613.90
5.3.10.0110.05113.71
5.3.00.0110.05213.75
5.2.170.0100.04211.36
5.2.160.0170.05011.27
5.2.150.0140.03711.12
5.2.140.0150.05011.34
5.2.130.0150.03411.25
5.2.120.0130.03611.32
5.2.110.0110.04611.12
5.2.100.0120.03611.25
5.2.90.0110.03811.10
5.2.80.0100.05011.09
5.2.70.0100.04011.30
5.2.60.0090.04011.19
5.2.50.0100.03910.95
5.2.40.0120.03411.13
5.2.30.0070.04111.11
5.2.20.0120.03710.96
5.2.10.0120.03611.05
5.2.00.0080.04110.59
5.1.60.0100.03210.14
5.1.50.0140.02810.22
5.1.40.0070.0359.96
5.1.30.0170.04410.46
5.1.20.0160.04210.40
5.1.10.0130.03010.14
5.1.00.0120.03110.36
5.0.50.0060.0288.75
5.0.40.0090.0278.55
5.0.30.0090.0408.42
5.0.20.0070.0268.18
5.0.10.0120.0258.05
5.0.00.0050.0428.30
4.4.90.0080.0187.90
4.4.80.0030.0237.90
4.4.70.0020.0247.90
4.4.60.0070.0197.90
4.4.50.0040.0237.90
4.4.40.0050.0357.90
4.4.30.0060.0217.90
4.4.20.0060.0207.90
4.4.10.0090.0177.90
4.4.00.0060.0327.90
4.3.110.0050.0227.90
4.3.100.0080.0177.90
4.3.90.0070.0187.90
4.3.80.0070.0317.90
4.3.70.0070.0187.90
4.3.60.0060.0207.90
4.3.50.0050.0237.90
4.3.40.0070.0307.90
4.3.30.0060.0197.90
4.3.20.0050.0217.90
4.3.10.0030.0227.90
4.3.00.0020.0237.90

preferences:
70.53 ms | 400 KiB | 5 Q