3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface DataTransferObject { public static function fromParams(array $params); public function asArray(); } trait DataTransferTrait { private static $mutable; private function __construct(array $params) { foreach ($params as $key => $value) { $this->{'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)))}($value); } unset($mutable); } public static function fromParams(array $params) { return new static($params); } public function asArray() { return get_object_vars($this); } public function __call($method, $args) { if (isset(self::$mutable) && substr($method, 0, 3) == 'set' && property_exists($this, lcfirst(substr($method, 3)))) { $this->{lcfirst(substr($method, 3))} = reset($args); } } } abstract class Command { } final class MyCommand extends Command implements DataTransferObject { use DataTransferTrait; private $foo; private $bar; private function setBar($value) { $this->bar = $value; } } $foo = MyCommand::fromParams(array('foo' => 'foo', 'bar' => 'bar', 'meh' => 'meh')); //$foo->setFoo('newfoo'); $foo->setDog('dog'); var_dump($foo);

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.0030.01718.43
8.3.50.0150.00821.28
8.3.40.0000.01518.74
8.3.30.0070.00719.27
8.3.20.0050.00220.16
8.3.10.0000.00721.90
8.3.00.0050.00319.38
8.2.180.0100.00716.63
8.2.170.0110.00422.96
8.2.160.0040.01120.35
8.2.150.0110.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00422.06
8.2.110.0210.00021.06
8.2.100.0000.01117.72
8.2.90.0060.00618.05
8.2.80.0000.00817.97
8.2.70.0060.00617.50
8.2.60.0000.01018.03
8.2.50.0040.00418.07
8.2.40.0000.01018.22
8.2.30.0000.00818.08
8.2.20.0000.00717.58
8.2.10.0000.00718.01
8.2.00.0000.00817.73
8.1.280.0140.00425.92
8.1.270.0080.00022.14
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00321.31
8.1.230.0060.00620.91
8.1.220.0030.00717.74
8.1.210.0050.00318.77
8.1.200.0060.00317.22
8.1.190.0040.00417.23
8.1.180.0080.00018.10
8.1.170.0030.00518.59
8.1.160.0000.00722.08
8.1.150.0080.00018.93
8.1.140.0040.00417.44
8.1.130.0030.00317.90
8.1.120.0040.00417.47
8.1.110.0080.00017.41
8.1.100.0070.00017.39
8.1.90.0060.00317.44
8.1.80.0000.00717.52
8.1.70.0070.00017.43
8.1.60.0000.01017.64
8.1.50.0040.00417.45
8.1.40.0090.00017.41
8.1.30.0040.00417.65
8.1.20.0040.00417.57
8.1.10.0040.00417.57
8.1.00.0030.00617.54
8.0.300.0050.00319.96
8.0.290.0040.00416.63
8.0.280.0030.00318.40
8.0.270.0050.00317.27
8.0.260.0000.00717.28
8.0.250.0000.00716.96
8.0.240.0080.00016.95
8.0.230.0030.00316.96
8.0.220.0070.00016.90
8.0.210.0000.00716.91
8.0.200.0000.00716.86
8.0.190.0040.00416.85
8.0.180.0000.00716.92
8.0.170.0000.00916.96
8.0.160.0000.00816.81
8.0.150.0000.00716.76
8.0.140.0030.00516.91
8.0.130.0000.00613.35
8.0.120.0070.00016.93
8.0.110.0050.00316.84
8.0.100.0000.00716.80
8.0.90.0000.00816.80
8.0.80.0090.00916.89
8.0.70.0000.00816.74
8.0.60.0080.00016.81
8.0.50.0040.00416.81
8.0.30.0140.00517.03
8.0.20.0060.01217.40
8.0.10.0000.00716.98
8.0.00.0110.00716.86
7.4.330.0000.00415.00
7.4.320.0040.00416.55
7.4.300.0000.00616.53
7.4.290.0000.00716.57
7.4.280.0060.00616.61
7.4.270.0030.00316.54
7.4.260.0040.00416.56
7.4.250.0040.00416.48
7.4.240.0050.00216.56
7.4.230.0040.00316.73
7.4.220.0260.00316.49
7.4.210.0070.00716.65
7.4.200.0040.00416.42
7.4.160.0100.00616.48
7.4.150.0040.01317.40
7.4.140.0120.00717.86
7.4.130.0070.01016.55
7.4.120.0070.01016.45
7.4.110.0130.00416.61
7.4.100.0030.01916.64
7.4.90.0140.00416.54
7.4.80.0120.01019.39
7.4.70.0120.00416.65
7.4.60.0090.00916.49
7.4.50.0050.00016.45
7.4.40.0060.01216.71
7.4.30.0110.01116.60
7.4.10.0050.01215.04
7.4.00.0070.01114.79
7.3.330.0000.00513.31
7.3.320.0020.00213.41
7.3.310.0000.00716.44
7.3.300.0070.00016.25
7.3.290.0080.00616.35
7.3.280.0060.00916.30
7.3.270.0180.00017.40
7.3.260.0110.01216.58
7.3.250.0070.00916.51
7.3.240.0130.00616.34
7.3.230.0090.00916.53
7.3.210.0130.00316.27
7.3.200.0040.01319.39
7.3.190.0170.00016.41
7.3.180.0090.00616.40
7.3.170.0060.01216.38
7.3.160.0100.00616.35
7.3.130.0040.01014.56
7.3.120.0080.01114.94
7.3.110.0080.00914.95
7.3.100.0080.00514.71
7.3.90.0090.00714.79
7.3.80.0090.00314.91
7.3.70.0060.00614.88
7.3.60.0080.00714.77
7.3.50.0090.00414.77
7.3.40.0050.00914.90
7.3.30.0080.00514.87
7.3.20.0050.00716.65
7.3.10.0030.01016.63
7.3.00.0070.00816.62
7.2.330.0110.00716.80
7.2.320.0110.00816.42
7.2.310.0110.01016.59
7.2.300.0080.01016.79
7.2.290.0060.01216.70
7.2.260.0080.00915.18
7.2.250.0080.00815.24
7.2.240.0080.00715.10
7.2.230.0060.01115.14
7.2.220.0050.01115.01
7.2.210.0050.00614.99
7.2.200.0040.00915.09
7.2.190.0070.00915.05
7.2.180.0090.00414.93
7.2.170.0040.01115.05
7.2.160.0050.00914.95
7.2.150.0040.00816.92
7.2.140.0060.00816.88
7.2.130.0060.01016.94
7.2.120.0060.00516.95
7.2.110.0050.00916.92
7.2.100.0040.00816.82
7.2.90.0060.00617.04
7.2.80.0020.01016.94
7.2.70.0050.00916.95
7.2.60.0050.00916.99
7.2.50.0050.01017.02
7.2.40.0040.01216.86
7.2.30.0080.00716.98
7.2.20.0050.00716.96
7.2.10.0040.00816.88
7.2.00.0060.00917.56
7.1.330.0090.00615.78
7.1.320.0020.01315.89
7.1.310.0040.01015.57
7.1.300.0030.01115.65
7.1.290.0010.00815.73
7.1.280.0050.00715.78
7.1.270.0030.00815.74
7.1.260.0060.00715.82
7.1.250.0080.00415.66
7.1.240.0080.00615.65
7.1.230.0060.00815.83
7.1.220.0020.00915.85
7.1.210.0090.00515.77
7.1.200.0070.00615.54
7.1.190.0060.00615.74
7.1.180.0060.00415.77
7.1.170.0030.01015.73
7.1.160.0010.00815.90
7.1.150.0070.00615.75
7.1.140.0010.01015.82
7.1.130.0050.00815.84
7.1.120.0060.00515.87
7.1.110.0030.00815.88
7.1.100.0040.00816.42
7.1.90.0070.00815.77
7.1.80.0040.00615.82
7.1.70.0060.00616.15
7.1.60.0070.00817.06
7.1.50.0070.01315.99
7.1.40.0010.01315.65
7.1.30.0070.00515.68
7.1.20.0050.00415.64
7.1.10.0020.01315.72
7.1.00.0050.02817.97
7.0.330.0060.00915.37
7.0.320.0080.00515.43
7.0.310.0080.00615.51
7.0.300.0080.00715.45
7.0.290.0060.00515.41
7.0.280.0030.00815.55
7.0.270.0080.00815.25
7.0.260.0040.00515.25
7.0.250.0050.00715.58
7.0.240.0030.00915.42
7.0.230.0020.00815.41
7.0.220.0090.00415.56
7.0.210.0090.00415.50
7.0.200.0050.00715.83
7.0.190.0070.00515.64
7.0.180.0040.01015.49
7.0.170.0030.01015.43
7.0.160.0070.00315.46
7.0.150.0050.00715.38
7.0.140.0040.03017.61
7.0.130.0040.00615.55
7.0.120.0030.01015.29
7.0.110.0330.02916.99
7.0.100.0260.03316.83
7.0.90.0290.03616.89
7.0.80.0290.03316.86
7.0.70.0290.03416.93
7.0.60.0320.03216.88
7.0.50.0280.02916.90
7.0.40.0070.03315.59
7.0.30.0080.02915.61
7.0.20.0040.02915.56
7.0.10.0080.03115.68
7.0.00.0060.01915.57
5.6.400.0000.01214.48
5.6.390.0060.00614.48
5.6.380.0030.00914.47
5.6.370.0040.00914.35
5.6.360.0040.00614.75
5.6.350.0080.00814.52
5.6.340.0080.00514.31
5.6.330.0040.01114.43
5.6.320.0040.01114.17
5.6.310.0060.00514.45
5.6.300.0090.00414.12
5.6.290.0030.01014.32
5.6.280.0040.02816.58
5.6.270.0030.01014.34
5.6.260.0050.02216.54
5.6.250.0090.03016.42
5.6.240.0070.02816.54
5.6.230.0040.03116.47
5.6.220.0090.03216.47
5.6.210.0030.03516.37
5.6.200.0060.02016.44
5.6.190.0030.03516.41
5.6.180.0080.03216.40
5.6.170.0040.03316.37
5.6.160.0120.02916.50
5.6.150.0090.02016.32
5.6.140.0030.03316.53
5.6.130.0100.03116.43
5.6.120.0070.03116.52
5.6.110.0050.03516.56
5.6.100.0040.03616.49
5.6.90.0090.02616.24
5.6.80.0090.02816.34
5.6.70.0060.02016.10
5.6.60.0080.03116.20
5.6.50.0100.02516.18
5.6.40.0070.02816.37
5.6.30.0100.02616.25
5.6.20.0070.03016.33
5.6.10.0060.03116.17
5.6.00.0040.02216.30
5.5.380.0050.01616.48
5.5.370.0020.03316.31
5.5.360.0120.02516.43
5.5.350.0060.03516.33
5.5.340.0070.02616.46
5.5.330.0040.03316.42
5.5.320.0050.03416.63
5.5.310.0050.03516.31
5.5.300.0110.02916.55
5.5.290.0090.02716.51
5.5.280.0090.03016.55
5.5.270.0020.03416.43
5.5.260.0040.02616.50
5.5.250.0100.02816.30
5.5.240.0070.03116.23
5.5.230.0020.03716.11
5.5.220.0080.02816.31
5.5.210.0090.02816.38
5.5.200.0080.02916.13
5.5.190.0070.03016.06
5.5.180.0070.02916.18
5.5.170.0010.00914.20
5.5.160.0060.03416.12
5.5.150.0040.02016.27
5.5.140.0020.03616.23
5.5.130.0060.02816.28
5.5.120.0040.03516.17
5.5.110.0050.02516.32
5.5.100.0030.02116.41
5.5.90.0020.03116.27
5.5.80.0070.02916.13
5.5.70.0090.01316.23
5.5.60.0080.02816.25
5.5.50.0090.01716.26
5.5.40.0030.03416.21
5.5.30.0050.02116.23
5.5.20.0080.03316.18
5.5.10.0080.03016.19
5.5.00.0040.03116.34
5.4.450.0080.01814.29
5.4.440.0060.02814.33
5.4.430.0090.02914.28
5.4.420.0080.02714.28
5.4.410.0040.03014.29
5.4.400.0040.02914.11
5.4.390.0050.03114.16
5.4.380.0040.02814.11
5.4.370.0060.02714.11
5.4.360.0040.02014.19
5.4.350.0040.02614.23
5.4.340.0030.03114.17
5.4.330.0020.00511.67
5.4.320.0030.03114.22
5.4.310.0080.02614.21
5.4.300.0060.02814.11
5.4.290.0040.02814.10
5.4.280.0090.02114.10
5.4.270.0030.02914.22
5.4.260.0040.02514.09
5.4.250.0030.03014.15
5.4.240.0090.02614.10
5.4.230.0030.01414.09
5.4.220.0060.02514.16
5.4.210.0090.02614.10
5.4.200.0070.02814.10
5.4.190.0050.02914.12
5.4.180.0070.02414.17
5.4.170.0050.02514.12
5.4.160.0080.02014.18
5.4.150.0050.03114.10
5.4.140.0060.02613.30
5.4.130.0020.03013.28
5.4.120.0050.02613.31
5.4.110.0060.02813.35
5.4.100.0030.02913.26
5.4.90.0070.02513.27
5.4.80.0060.02613.27
5.4.70.0040.02913.23
5.4.60.0070.02813.24
5.4.50.0020.03313.29
5.4.40.0060.02813.26
5.4.30.0050.02913.26
5.4.20.0050.02713.24
5.4.10.0070.01413.29
5.4.00.0020.03313.09
5.3.290.0070.06314.90
5.3.280.0070.07314.61
5.3.270.0100.07314.61
5.3.260.0170.06714.63
5.3.250.0130.07014.75
5.3.240.0000.08014.63
5.3.230.0030.04714.48
5.3.220.0030.07714.70
5.3.210.0100.07714.60
5.3.200.0030.07714.56
5.3.190.0070.07314.57
5.3.180.0130.07014.59
5.3.170.0000.07014.57
5.3.160.0100.06314.58
5.3.150.0100.07014.56
5.3.140.0030.04714.79
5.3.130.0070.07314.78
5.3.120.0030.07714.64
5.3.110.0070.07714.52
5.3.100.0100.07014.07
5.3.90.0070.07314.03
5.3.80.0070.07313.88
5.3.70.0100.07014.03
5.3.60.0070.07713.98
5.3.50.0030.07314.09
5.3.40.0130.07313.80
5.3.30.0200.04713.90
5.3.20.0100.07013.70
5.3.10.0100.07313.79
5.3.00.0030.07013.73
5.2.170.0030.06712.09
5.2.160.0070.06312.09
5.2.150.0030.05312.09
5.2.140.0030.06312.09
5.2.130.0030.06312.09
5.2.120.0030.06012.09
5.2.110.0030.06012.09
5.2.100.0030.06312.09
5.2.90.0100.04012.09
5.2.80.0030.06012.09
5.2.70.0030.06312.09
5.2.60.0130.05312.09
5.2.50.0070.06012.09
5.2.40.0030.03712.09
5.2.30.0070.03012.09
5.2.20.0030.05012.09
5.2.10.0030.05712.09
5.2.00.0070.05712.09
5.1.60.0000.05312.09
5.1.50.0230.04012.09
5.1.40.0130.04012.09
5.1.30.0030.04712.09
5.1.20.0070.06012.09
5.1.10.0000.04012.09
5.1.00.0100.05012.09
5.0.50.0030.04312.09
5.0.40.0100.03712.09
5.0.30.0070.06012.09
5.0.20.0030.03712.09
5.0.10.0070.03712.09
5.0.00.0000.03712.09
4.4.90.0130.02712.09
4.4.80.0000.03712.09
4.4.70.0000.02012.09
4.4.60.0070.03012.09
4.4.50.0030.03312.09
4.4.40.0000.05712.09
4.4.30.0030.03312.09
4.4.20.0100.02712.09
4.4.10.0000.03712.09
4.4.00.0130.04012.09
4.3.110.0000.03712.09
4.3.100.0000.03312.09
4.3.90.0070.02012.09
4.3.80.0070.03712.09
4.3.70.0000.03312.09
4.3.60.0030.02012.09
4.3.50.0000.04012.09
4.3.40.0000.02712.09
4.3.30.0000.02012.09
4.3.20.0000.02712.09
4.3.10.0000.02712.09
4.3.00.0030.03712.09

preferences:
55.85 ms | 401 KiB | 5 Q