3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface DataTransferObject { public static function fromParams(array $params); public function asArray(); } trait DataTransferTrait { private function __construct(array $params) { foreach ($params as $key => $value) { $this->{'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)))}($value); } } 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($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.0170.00318.08
8.3.50.0120.01021.25
8.3.40.0100.01018.57
8.3.30.0150.00019.05
8.3.20.0070.00020.30
8.3.10.0000.00821.90
8.3.00.0030.00619.11
8.2.180.0070.00718.42
8.2.170.0140.00422.96
8.2.160.0030.01020.47
8.2.150.0030.00524.18
8.2.140.0070.00024.66
8.2.130.0000.00826.16
8.2.120.0070.00420.26
8.2.110.0100.00020.36
8.2.100.0090.00317.85
8.2.90.0030.00618.22
8.2.80.0040.00417.97
8.2.70.0070.00417.63
8.2.60.0060.00317.93
8.2.50.0030.00518.07
8.2.40.0030.00618.16
8.2.30.0040.00418.01
8.2.20.0000.00717.59
8.2.10.0000.00717.96
8.2.00.0040.00417.71
8.1.280.0140.00725.92
8.1.270.0030.00622.00
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0090.00022.01
8.1.230.0070.00420.87
8.1.220.0060.00317.74
8.1.210.0050.00318.82
8.1.200.0060.00317.35
8.1.190.0050.00317.48
8.1.180.0040.00418.10
8.1.170.0090.00318.41
8.1.160.0000.00922.04
8.1.150.0070.00018.97
8.1.140.0050.00217.46
8.1.130.0030.00317.80
8.1.120.0050.00317.55
8.1.110.0040.00417.37
8.1.100.0000.00717.52
8.1.90.0030.00617.53
8.1.80.0070.00017.45
8.1.70.0030.00317.46
8.1.60.0080.00317.57
8.1.50.0000.00817.58
8.1.40.0030.00617.58
8.1.30.0050.00317.63
8.1.20.0000.00817.61
8.1.10.0040.00417.61
8.1.00.0000.00817.54
8.0.300.0050.00320.04
8.0.290.0060.00316.63
8.0.280.0030.00318.55
8.0.270.0070.00016.84
8.0.260.0000.00717.29
8.0.250.0040.00316.88
8.0.240.0050.00316.85
8.0.230.0000.00816.93
8.0.220.0030.00316.98
8.0.210.0000.00716.91
8.0.200.0030.00316.99
8.0.190.0080.00017.00
8.0.180.0040.00416.96
8.0.170.0040.00416.87
8.0.160.0030.00416.92
8.0.150.0000.00716.89
8.0.140.0050.00316.76
8.0.130.0030.00313.30
8.0.120.0030.00616.94
8.0.110.0040.00416.83
8.0.100.0040.00416.95
8.0.90.0040.00416.83
8.0.80.0130.00916.89
8.0.70.0000.00816.86
8.0.60.0000.00916.75
8.0.50.0050.00216.97
8.0.30.0080.01117.05
8.0.20.0100.00917.41
8.0.10.0040.00417.03
8.0.00.0100.00816.65
7.4.330.0050.00015.00
7.4.320.0030.00316.53
7.4.300.0060.00016.43
7.4.290.0000.00816.55
7.4.280.0030.00716.63
7.4.270.0030.00316.54
7.4.260.0000.00716.62
7.4.250.0000.00816.40
7.4.240.0030.00516.53
7.4.230.0040.00416.65
7.4.220.0120.00616.56
7.4.210.0110.00416.63
7.4.200.0000.00716.37
7.4.160.0100.00616.73
7.4.150.0060.01217.40
7.4.140.0080.01017.86
7.4.130.0130.00916.57
7.4.120.0060.01116.50
7.4.110.0070.01116.59
7.4.100.0150.00316.50
7.4.90.0100.00716.46
7.4.80.0040.01419.39
7.4.70.0040.01216.70
7.4.60.0100.00616.50
7.4.50.0000.00916.43
7.4.40.0090.01216.54
7.4.30.0090.01516.39
7.4.10.0040.01515.14
7.4.00.0070.01014.92
7.3.330.0030.00313.13
7.3.320.0050.00013.23
7.3.310.0030.00316.20
7.3.300.0060.00016.35
7.3.290.0050.00816.35
7.3.280.0130.00516.33
7.3.270.0080.01117.40
7.3.260.0120.00616.23
7.3.250.0140.00416.49
7.3.240.0070.01516.64
7.3.230.0080.00816.43
7.3.210.0090.00916.71
7.3.200.0140.00919.39
7.3.190.0100.01116.43
7.3.180.0100.00716.38
7.3.170.0090.01216.45
7.3.160.0080.00816.30
7.3.130.0040.01214.89
7.3.120.0120.00614.91
7.3.110.0070.01314.99
7.3.100.0030.00914.60
7.3.90.0140.00714.73
7.3.80.0070.00715.01
7.3.70.0030.01414.75
7.3.60.0110.00414.99
7.3.50.0040.01514.88
7.3.40.0030.01014.82
7.3.30.0110.00414.90
7.3.20.0060.00916.41
7.3.10.0030.00916.62
7.3.00.0070.01016.76
7.2.330.0150.00316.75
7.2.320.0120.00616.47
7.2.310.0000.01716.43
7.2.300.0060.01316.71
7.2.290.0140.00316.68
7.2.260.0030.01614.99
7.2.250.0130.00314.98
7.2.240.0000.01515.27
7.2.230.0130.00614.97
7.2.220.0100.00615.06
7.2.210.0130.00715.20
7.2.200.0000.01314.82
7.2.190.0030.01214.93
7.2.180.0090.00914.91
7.2.170.0040.01114.97
7.2.160.0040.00814.79
7.2.150.0070.00717.05
7.2.140.0030.01917.02
7.2.130.0060.00916.96
7.2.120.0030.01317.10
7.2.110.0000.01416.93
7.2.100.0100.00317.04
7.2.90.0070.00317.00
7.2.80.0030.01317.00
7.2.70.0130.00317.00
7.2.60.0070.00716.96
7.2.50.0080.00817.10
7.2.40.0000.01917.05
7.2.30.0040.01217.14
7.2.20.0090.00616.75
7.2.10.0040.01216.98
7.2.00.0100.00518.23
7.1.330.0110.00415.88
7.1.320.0100.00715.73
7.1.310.0090.00315.89
7.1.300.0090.00015.88
7.1.290.0040.01115.83
7.1.280.0000.01415.57
7.1.270.0070.00715.75
7.1.260.0100.00615.75
7.1.250.0030.01315.99
7.1.240.0030.01015.78
7.1.230.0030.00916.01
7.1.220.0000.01415.72
7.1.210.0120.00316.00
7.1.200.0030.00815.88
7.1.190.0140.00315.86
7.1.180.0070.00715.82
7.1.170.0150.00315.76
7.1.160.0000.01015.39
7.1.150.0100.00715.79
7.1.140.0070.00715.75
7.1.130.0080.00015.90
7.1.120.0040.01115.93
7.1.110.0060.00615.84
7.1.100.0050.00716.98
7.1.90.0000.01015.61
7.1.80.0000.01315.97
7.1.70.0080.00316.51
7.1.60.0080.00817.66
7.1.50.0110.00516.31
7.1.40.0060.00615.59
7.1.30.0090.00015.77
7.1.20.0070.00715.89
7.1.10.0080.00415.73
7.1.00.0010.04319.13
7.0.330.0060.00615.51
7.0.320.0090.00615.47
7.0.310.0110.00015.36
7.0.300.0030.01215.52
7.0.290.0070.00715.57
7.0.280.0110.00415.49
7.0.270.0030.00515.48
7.0.260.0090.00315.57
7.0.250.0030.00615.46
7.0.240.0080.00415.52
7.0.230.0080.00415.31
7.0.220.0090.00315.28
7.0.210.0030.01015.11
7.0.200.0050.00715.93
7.0.190.0030.00715.28
7.0.180.0000.01015.47
7.0.170.0030.01015.41
7.0.160.0030.00715.60
7.0.150.0030.00915.40
7.0.140.0060.04018.81
7.0.130.0130.00015.38
7.0.120.0040.01115.64
7.0.110.0060.00615.51
7.0.100.0000.00915.60
7.0.90.0030.01315.44
7.0.80.0090.00615.32
7.0.70.0040.00815.47
7.0.60.0070.03817.59
7.0.50.0030.02816.68
7.0.40.0070.04216.77
7.0.30.0170.04716.75
7.0.20.0170.02516.77
7.0.10.0080.02916.71
7.0.00.0030.02816.76
5.6.400.0060.00314.57
5.6.390.0070.01014.09
5.6.380.0150.00314.18
5.6.370.0000.00914.44
5.6.360.0100.00313.93
5.6.350.0120.00314.60
5.6.340.0040.00814.57
5.6.330.0060.00914.54
5.6.320.0080.00514.53
5.6.310.0090.00014.62
5.6.300.0110.00714.05
5.6.290.0030.01014.12
5.6.280.0060.04017.83
5.6.270.0080.00814.34
5.6.260.0030.01014.41
5.6.250.0030.01014.33
5.6.240.0100.00614.16
5.6.230.0000.01514.34
5.6.220.0080.00814.20
5.6.210.0080.02417.43
5.6.200.0080.02216.34
5.6.190.0110.03117.42
5.6.180.0150.02517.42
5.6.170.0100.04517.42
5.6.160.0030.03117.66
5.6.150.0070.03316.27
5.6.140.0070.02216.35
5.6.130.0040.02616.20
5.6.120.0120.04517.69
5.6.110.0070.04117.73
5.6.100.0110.02317.70
5.6.90.0080.03817.67
5.6.80.0060.04517.19
5.6.70.2370.02217.44
5.6.60.0100.00714.27
5.6.50.0030.01014.34
5.6.40.0030.01014.45
5.6.30.0080.00814.41
5.6.20.0110.00414.53
5.6.10.0090.00314.25
5.6.00.0000.01114.20
5.5.380.0060.00614.27
5.5.370.0070.00714.32
5.5.360.0070.00714.25
5.5.350.0100.04617.50
5.5.340.0070.03916.08
5.5.330.0040.04417.16
5.5.320.0200.02217.30
5.5.310.0150.02917.44
5.5.300.0080.03516.14
5.5.290.0060.02316.23
5.5.280.0060.04717.63
5.5.270.0070.02717.70
5.5.260.0050.02617.61
5.5.250.0130.03317.57
5.5.240.0120.04517.22
5.5.230.0060.00914.47
5.5.220.0060.00614.33
5.5.210.0040.01114.58
5.5.200.0060.00313.93
5.5.190.0130.00014.23
5.5.180.0060.01014.17
5.5.170.0000.00814.26
5.5.160.0100.00314.48
5.5.150.0030.00614.49
5.5.140.0060.00613.98
5.5.130.0120.00314.23
5.5.120.0000.01114.46
5.5.110.0040.00414.21
5.5.100.0110.00414.43
5.5.90.0070.00714.14
5.5.80.0070.00714.22
5.5.70.0140.00313.91
5.5.60.0030.00614.17
5.5.50.0080.00314.44
5.5.40.0070.00714.21
5.5.30.0060.00614.39
5.5.20.0060.01014.40
5.5.10.0060.00914.01
5.5.00.0090.00014.23
5.4.450.0280.03515.56
5.4.440.0470.03215.68
5.4.430.0400.03415.62
5.4.420.0350.00215.65
5.4.410.0330.00315.60
5.4.400.0380.00615.45
5.4.390.0470.00315.38
5.4.380.0390.00015.40
5.4.370.0400.00315.49
5.4.360.0350.00015.44
5.4.350.0370.00415.44
5.4.340.0090.02011.90
5.4.330.0060.00611.77
5.4.320.0080.02412.15
5.4.310.0080.02012.14
5.4.300.0060.02212.15
5.4.290.0050.02412.14
5.4.280.0030.02312.09
5.4.270.0040.02412.09
5.4.260.0080.01912.09
5.4.250.0060.02012.09
5.4.240.0060.01912.09
5.4.230.0060.02012.09
5.4.220.0060.02212.09
5.4.210.0070.02712.09
5.4.200.0020.02612.09
5.4.190.0050.02412.09
5.4.180.0080.01812.09
5.4.170.0060.02112.09
5.4.160.0050.02312.09
5.4.150.0060.02212.09
5.4.140.0090.02211.93
5.4.130.0040.02211.92
5.4.120.0040.02311.90
5.4.110.0030.02111.90
5.4.100.0050.02311.90
5.4.90.0090.02111.90
5.4.80.0070.02311.90
5.4.70.0030.03211.90
5.4.60.0040.02511.90
5.4.50.0040.01911.90
5.4.40.0050.02011.89
5.4.30.0050.02011.89
5.4.20.0020.02411.89
5.4.10.0050.01811.89
5.4.00.0040.02311.63
5.3.290.0070.04412.80
5.3.280.0120.04212.70
5.3.270.0070.04312.72
5.3.260.0090.04212.72
5.3.250.0090.03712.72
5.3.240.0050.04512.72
5.3.230.0060.04112.71
5.3.220.0060.04212.68
5.3.210.0100.04112.68
5.3.200.0080.04212.68
5.3.190.0080.04012.68
5.3.180.0060.03712.67
5.3.170.0040.03912.67
5.3.160.0060.03812.67
5.3.150.0060.03812.67
5.3.140.0090.03412.66
5.3.130.0070.04312.66
5.3.120.0070.03812.66
5.3.110.0050.04112.66
5.3.100.0080.03912.13
5.3.90.0040.03912.11
5.3.80.0070.03812.09
5.3.70.0030.04212.09
5.3.60.0040.04112.08
5.3.50.0090.03512.03
5.3.40.0080.04712.03
5.3.30.0070.04311.99
5.3.20.0060.03811.77
5.3.10.0070.03711.73
5.3.00.0020.04111.72
5.2.170.0060.0299.22
5.2.160.0050.0389.22
5.2.150.0050.0369.22
5.2.140.0030.0349.22
5.2.130.0050.0329.18
5.2.120.0050.0339.18
5.2.110.0080.0289.19
5.2.100.0120.0289.18
5.2.90.0100.0329.19
5.2.80.0080.0349.18
5.2.70.0070.0339.18
5.2.60.0060.0329.14
5.2.50.0050.0319.11
5.2.40.0070.0289.09
5.2.30.0070.0309.05
5.2.20.0070.0279.04
5.2.10.0070.0298.95
5.2.00.0020.0378.81
5.1.60.0040.0338.09
5.1.50.0110.0268.09
5.1.40.0040.0338.07
5.1.30.0080.0278.43
5.1.20.0070.0548.45
5.1.10.0060.0298.18
5.1.00.0050.0338.17
5.0.50.0040.0266.64
5.0.40.0030.0266.50
5.0.30.0050.0356.31
5.0.20.0040.0206.28
5.0.10.0050.0206.26
5.0.00.0040.0316.25
4.4.90.0010.0204.78
4.4.80.0040.0154.75
4.4.70.0040.0154.75
4.4.60.0080.0114.75
4.4.50.0030.0164.77
4.4.40.0030.0254.70
4.4.30.0050.0134.76
4.4.20.0050.0144.85
4.4.10.0010.0184.84
4.4.00.0010.0294.76
4.3.110.0010.0204.67
4.3.100.0070.0124.66
4.3.90.0020.0164.63
4.3.80.0030.0244.58
4.3.70.0030.0154.63
4.3.60.0010.0174.63
4.3.50.0040.0144.63
4.3.40.0040.0254.54
4.3.30.0010.0183.29
4.3.20.0020.0163.26
4.3.10.0010.0183.22
4.3.00.0200.0237.08

preferences:
46.34 ms | 401 KiB | 5 Q