3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace App\ServerArbiter; use App\ServerArbiter\Rules\Rule; /** * Class RuleSet * * @package App\ServerArbiter */ class RuleSet implements \Iterator { /** * @var Rule[] An array of Rule objects */ private $rules; /** * @var int Iterator position key */ private $position = 0; /** * @constructor */ public function __construct() { $this->position = 0; } /** * Add a Rule to the RuleSet * * @param Rule $rule */ public function addRule(Rule $rule) { if (!in_array($rule, $this->rules)) { $this->rules[] = $rule; } } /** * Remove a Rule from the RuleSet by it's key * * @param int $ruleKey The numeric key within the rules array to unset * * @throws \OutOfBoundsException When a non-existant key is provided * @throws \InvalidArgumentException When a non-integer parameter is provided */ public function removeRule($ruleKey) { if (is_int($ruleKey)) { if (array_key_exists($ruleKey, $this->rules)) { unset($this->rules[$ruleKey]); } else { throw new \OutOfBoundsException(sprintf( "%s was passed a out of bounds array key: %s does not exist in this ruleset", __METHOD__, $ruleKey )); } } else { throw new \InvalidArgumentException(sprintf( "%s expected an integer ruleKey parameter, got: '%s' instead", __METHOD__, $ruleKey )); } } /** * {@inheritdoc} * * @return Rule */ public function current() { return $this->rules[$this->position]; } /** * {@inheritdoc} */ public function next() { ++$this->position; } /** * {@inheritdoc} */ public function key() { return $this->position; } /** * {@inheritdoc} */ public function valid() { return isset($this->rules[$this->position]); } /** * {@inheritdoc} */ public function rewind() { $this->position = 0; } }

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.70.0090.00616.75
8.3.60.0070.00716.63
8.3.50.0080.01121.99
8.3.40.0110.00418.63
8.3.30.0120.00318.78
8.3.20.0070.00020.34
8.3.10.0030.00523.71
8.3.00.0080.00019.13
8.2.180.0120.00318.44
8.2.170.0120.00322.96
8.2.160.0100.00320.43
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0000.01426.16
8.2.120.0040.00420.87
8.2.110.0060.00322.19
8.2.100.0040.00817.72
8.2.90.0040.00419.05
8.2.80.0040.00417.97
8.2.70.0060.00617.38
8.2.60.0040.00417.64
8.2.50.0000.00818.07
8.2.40.0080.00018.03
8.2.30.0000.00717.90
8.2.20.0000.00717.65
8.2.10.0050.00218.07
8.2.00.0000.00817.74
8.1.280.0110.00425.92
8.1.270.0090.00022.04
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00623.77
8.1.230.0110.00019.15
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0000.00817.53
8.1.180.0050.00318.10
8.1.170.0000.00818.51
8.1.160.0070.00022.05
8.1.150.0070.00018.54
8.1.140.0030.00617.43
8.1.130.0040.00417.78
8.1.120.0000.00817.38
8.1.110.0000.00817.40
8.1.100.0070.00017.42
8.1.90.0000.00717.35
8.1.80.0040.00417.50
8.1.70.0030.00517.28
8.1.60.0000.00817.57
8.1.50.0030.00517.40
8.1.40.0080.00017.38
8.1.30.0040.00417.61
8.1.20.0000.00817.51
8.1.10.0000.00817.47
8.1.00.0000.00817.44
8.0.300.0040.00418.77
8.0.290.0040.00417.04
8.0.280.0040.00418.41
8.0.270.0000.00717.13
8.0.260.0030.00317.09
8.0.250.0030.00316.93
8.0.240.0000.00716.79
8.0.230.0000.00716.93
8.0.220.0070.00016.77
8.0.210.0040.00416.86
8.0.200.0050.00316.94
8.0.190.0040.00316.93
8.0.180.0030.00316.87
8.0.170.0040.00416.77
8.0.160.0040.00416.76
8.0.150.0000.00716.84
8.0.140.0050.00316.79
8.0.130.0060.00013.32
8.0.120.0040.00416.83
8.0.110.0050.00216.68
8.0.100.0070.00016.88
8.0.90.0000.00716.97
8.0.80.0040.01116.74
8.0.70.0090.00016.84
8.0.60.0000.00716.75
8.0.50.0040.00416.87
8.0.30.0180.00516.92
8.0.20.0120.00617.40
8.0.10.0040.00417.03
8.0.00.0120.00716.76
7.4.330.0000.00515.00
7.4.320.0000.00816.38
7.4.300.0060.00016.57
7.4.290.0000.00716.61
7.4.280.0000.01116.45
7.4.270.0060.00316.45
7.4.260.0040.00416.59
7.4.250.0070.00016.39
7.4.240.0050.00216.51
7.4.230.0030.00316.56
7.4.220.0090.00916.38
7.4.210.0060.01016.64
7.4.200.0030.00316.38
7.4.190.0030.00516.41
7.4.160.0100.00716.42
7.4.150.0110.00717.40
7.4.140.0130.00717.86
7.4.130.0050.01216.52
7.4.120.0030.01416.57
7.4.110.0090.00916.31
7.4.100.0120.00616.50
7.4.90.0120.00816.49
7.4.80.0110.00819.39
7.4.70.0080.00816.50
7.4.60.0070.01016.47
7.4.50.0000.00816.39
7.4.40.0120.00422.77
7.4.30.0060.01516.47
7.4.00.0040.00815.09
7.3.330.0000.00713.24
7.3.320.0030.00313.16
7.3.310.0080.00016.06
7.3.300.0050.00216.19
7.3.290.0090.00316.28
7.3.280.0150.00316.21
7.3.270.0210.00317.40
7.3.260.0150.00916.31
7.3.250.0120.00616.30
7.3.240.0030.01516.47
7.3.230.0000.01716.44
7.3.210.0060.01116.46
7.3.200.0140.00319.39
7.3.190.0060.01616.28
7.3.180.0060.01316.20
7.3.170.0060.00916.53
7.3.160.0100.00616.41
7.3.120.0180.00014.61
7.3.10.0110.00416.52
7.3.00.0030.01216.40
7.2.330.0030.01416.64
7.2.320.0100.01316.57
7.2.310.0070.01016.53
7.2.300.0120.01016.39
7.2.290.0120.00916.41
7.2.130.0030.01316.95
7.2.120.0120.00316.70
7.2.110.0080.00816.65
7.2.100.0060.01016.66
7.2.90.0100.00316.84
7.2.80.0000.01316.85
7.2.70.0030.01016.48
7.2.60.0090.00216.75
7.2.50.0070.00716.89
7.2.40.0090.00916.81
7.2.30.0070.01116.75
7.2.20.0070.01016.77
7.2.10.0110.00716.78
7.2.00.0050.00718.09
7.1.250.0030.00915.66
7.1.200.0060.00915.66
7.1.100.0000.01217.71
7.1.70.0100.00316.82
7.1.60.0140.01019.33
7.1.50.0090.00616.86
7.1.00.0170.06322.54
7.0.200.0150.00414.39
7.0.140.0030.07322.21
7.0.60.0070.04319.91
7.0.50.0030.06017.90
7.0.40.0070.08720.20
7.0.30.0430.04020.13
7.0.20.0230.06020.15
7.0.10.0000.09320.25
7.0.00.0030.07320.20
5.6.280.0030.07321.17
5.6.210.0070.08020.56
5.6.200.0170.03718.19
5.6.190.0100.03720.63
5.6.180.0300.06720.50
5.6.170.0270.05320.39
5.6.160.0070.04720.39
5.6.150.0130.07318.16
5.6.140.0100.07718.21
5.6.130.0070.04318.15
5.6.120.0100.08721.05
5.6.110.0070.05320.98
5.6.100.0000.07721.09
5.6.90.0170.06321.01
5.6.80.0030.03720.54
5.6.70.4430.03720.40
5.5.350.0070.03320.38
5.5.340.0030.03717.99
5.5.330.0000.04320.13
5.5.320.0030.05320.43
5.5.310.0100.04720.27
5.5.300.0070.04317.99
5.5.290.0070.08018.00
5.5.280.0100.05020.91
5.5.270.0030.06720.89
5.5.260.0070.05720.81
5.5.250.0030.08320.63
5.5.240.0130.07320.29
5.4.450.0930.04319.70
5.4.440.0870.07019.47
5.4.430.0830.06719.47
5.4.420.0700.06019.16
5.4.410.0030.06019.42
5.4.400.0800.06019.16
5.4.390.0830.05719.22
5.4.380.0330.05718.74
5.4.370.0200.06018.78
5.4.360.0130.06318.62
5.4.350.0270.05718.77
5.4.340.0300.07018.60
5.4.320.0080.03812.52
5.4.310.0060.03912.51
5.4.300.0090.04212.52
5.4.290.0080.04112.51
5.4.280.0080.04112.41
5.4.270.0090.04212.41
5.4.260.0080.04112.41
5.4.250.0060.04312.41
5.4.240.0110.03512.41
5.4.230.0100.04112.40
5.4.220.0060.03912.41
5.4.210.0090.04712.41
5.4.200.0080.04212.40
5.4.190.0050.04112.40
5.4.180.0100.04012.40
5.4.170.0080.03912.41
5.4.160.0100.03912.41
5.4.150.0100.04012.40
5.4.140.0050.04312.09
5.4.130.0080.04412.07
5.4.120.0040.04012.04
5.4.110.0090.04312.02
5.4.100.0090.03512.03
5.4.90.0090.04012.02
5.4.80.0050.04012.03
5.4.70.0080.03912.03
5.4.60.0030.04112.02
5.4.50.0080.03512.03
5.4.40.0060.03812.02
5.4.30.0060.03412.01
5.4.20.0040.04712.01
5.4.10.0120.04012.00
5.4.00.0080.04011.50
5.3.290.0060.04112.80
5.3.280.0100.03812.71
5.3.270.0070.05012.72
5.3.260.0100.04612.72
5.3.250.0070.04212.72
5.3.240.0130.04512.72
5.3.230.0070.03612.71
5.3.220.0070.04112.68
5.3.210.0100.04712.68
5.3.200.0070.04112.68
5.3.190.0080.04412.68
5.3.180.0110.03312.68
5.3.170.0080.04312.67
5.3.160.0060.04012.68
5.3.150.0090.04212.67
5.3.140.0060.05112.66
5.3.130.0090.04012.66
5.3.120.0070.04312.66
5.3.110.0090.04712.66
5.3.100.0090.03612.14
5.3.90.0060.04312.13
5.3.80.0080.04612.12
5.3.70.0100.04212.11
5.3.60.0110.04312.11
5.3.50.0060.04212.05
5.3.40.0050.03712.05
5.3.30.0070.04212.01
5.3.20.0090.03911.79
5.3.10.0090.04111.76
5.3.00.0070.04011.74
5.2.170.0070.0289.18
5.2.160.0050.0309.18
5.2.150.0040.0309.19
5.2.140.0030.0329.18
5.2.130.0090.0279.14
5.2.120.0050.0279.14
5.2.110.0070.0379.15
5.2.100.0090.0419.14
5.2.90.0050.0389.14
5.2.80.0100.0309.14
5.2.70.0080.0459.14
5.2.60.0070.0359.10
5.2.50.0050.0289.07
5.2.40.0060.0379.04
5.2.30.0030.0349.01
5.2.20.0030.0389.00
5.2.10.0060.0268.93
5.2.00.0050.0328.79
5.1.60.0100.0288.07
5.1.50.0040.0248.06
5.1.40.0080.0238.05
5.1.30.0060.0238.39
5.1.20.0070.0288.42
5.1.10.0040.0368.14
5.1.00.0060.0308.14
5.0.50.0010.0326.62
5.0.40.0020.0286.48
5.0.30.0050.0336.29
5.0.20.0050.0276.26
5.0.10.0030.0226.25
5.0.00.0050.0286.23
4.4.90.0040.0144.78
4.4.80.0030.0154.75
4.4.70.0020.0164.75
4.4.60.0060.0184.76
4.4.50.0050.0204.77
4.4.40.0010.0274.71
4.4.30.0040.0204.76
4.4.20.0020.0234.84
4.4.10.0050.0204.85
4.4.00.0030.0244.76
4.3.110.0030.0224.67
4.3.100.0050.0154.66
4.3.90.0030.0224.63
4.3.80.0020.0334.58
4.3.70.0040.0224.63
4.3.60.0030.0164.63
4.3.50.0050.0164.63
4.3.40.0030.0234.54
4.3.30.0030.0223.28
4.3.20.0040.0203.26
4.3.10.0030.0223.22
4.3.00.0300.03010.37

preferences:
38.17 ms | 401 KiB | 5 Q