3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractCommand { 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 (substr($method, 0, 3) == 'set' && property_exists($this, lcfirst(substr($method, 3)))) { $this->{lcfirst(substr($method, 3))} = reset($args); } } } trait DTO{} class Command extends AbstractCommand { protected $foo; } $foo = Command::fromParams(array('foo' => 'foo')); 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.0140.00418.31
8.3.50.0070.01516.30
8.3.40.0140.00018.59
8.3.30.0030.01418.90
8.3.20.0070.00020.33
8.3.10.0080.00023.61
8.3.00.0000.00819.13
8.2.180.0040.01116.75
8.2.170.0110.00322.96
8.2.160.0110.00420.35
8.2.150.0040.01124.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0050.00322.05
8.2.110.0030.00720.35
8.2.100.0040.00718.16
8.2.90.0050.00319.22
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0000.00817.92
8.2.50.0090.00018.07
8.2.40.0040.00420.07
8.2.30.0030.00618.16
8.2.20.0050.00217.66
8.2.10.0040.00418.15
8.2.00.0080.00017.59
8.1.280.0120.00925.92
8.1.270.0000.00822.11
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00923.96
8.1.230.0090.00319.14
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.38
8.1.180.0040.00418.10
8.1.170.0080.00018.57
8.1.160.0050.00222.05
8.1.150.0000.00718.79
8.1.140.0040.00417.49
8.1.130.0030.00317.86
8.1.120.0040.00417.50
8.1.110.0070.00017.51
8.1.100.0050.00317.39
8.1.90.0040.00417.41
8.1.80.0040.00417.51
8.1.70.0030.00517.43
8.1.60.0070.00417.65
8.1.50.0040.00417.55
8.1.40.0040.00417.42
8.1.30.0000.00917.69
8.1.20.0040.00417.57
8.1.10.0050.00217.64
8.1.00.0040.00417.58
8.0.300.0000.00718.77
8.0.290.0080.00016.63
8.0.280.0030.00318.47
8.0.270.0030.00317.28
8.0.260.0030.00317.22
8.0.250.0070.00017.04
8.0.240.0070.00016.99
8.0.230.0060.00317.01
8.0.220.0080.00016.81
8.0.210.0070.00016.90
8.0.200.0030.00316.98
8.0.190.0040.00416.88
8.0.180.0040.00416.81
8.0.170.0030.00516.85
8.0.160.0040.00416.86
8.0.150.0030.00316.87
8.0.140.0040.00416.78
8.0.130.0000.00613.36
8.0.120.0030.00516.94
8.0.110.0030.00616.82
8.0.100.0040.00416.85
8.0.90.0050.00316.90
8.0.80.0070.01116.88
8.0.70.0040.00416.78
8.0.60.0030.00616.95
8.0.50.0000.00816.86
8.0.30.0110.01117.08
8.0.20.0140.01017.40
8.0.10.0030.00517.02
8.0.00.0110.00716.73
7.4.330.0020.00215.00
7.4.320.0000.00816.39
7.4.300.0030.00316.55
7.4.290.0030.00316.52
7.4.280.0060.00616.62
7.4.270.0030.00316.54
7.4.260.0000.00716.66
7.4.250.0040.00416.61
7.4.240.0060.00116.60
7.4.230.0030.00316.43
7.4.220.0070.01016.49
7.4.210.0040.00916.63
7.4.200.0000.00716.62
7.4.160.0030.01316.38
7.4.150.0100.00717.40
7.4.140.0080.01017.86
7.4.130.0090.00816.42
7.4.120.0070.01116.58
7.4.110.0060.01216.66
7.4.100.0130.00616.66
7.4.90.0070.01016.69
7.4.80.0070.01119.39
7.4.70.0060.01016.42
7.4.60.0030.01316.47
7.4.50.0030.00616.66
7.4.40.0090.00816.78
7.4.30.0080.00816.43
7.4.00.0020.01514.96
7.3.330.0050.00013.17
7.3.320.0000.00513.29
7.3.310.0070.00016.36
7.3.300.0050.00216.33
7.3.290.0090.00616.34
7.3.280.0080.00616.29
7.3.270.0100.01017.40
7.3.260.0120.00816.33
7.3.250.0110.00816.34
7.3.240.0050.01916.56
7.3.230.0030.01316.39
7.3.210.0070.01016.23
7.3.200.0120.00419.39
7.3.190.0140.00316.46
7.3.180.0100.01016.35
7.3.170.0060.01616.41
7.3.160.0040.01116.53
7.3.120.0130.00614.88
7.3.110.0110.00414.71
7.3.100.0070.00715.14
7.3.90.0100.00314.60
7.3.80.0080.00814.79
7.3.70.0080.00414.83
7.3.60.0070.00714.61
7.3.50.0060.01314.94
7.3.40.0040.00714.82
7.3.30.0090.00314.86
7.3.20.0040.00416.72
7.3.10.0020.01216.73
7.3.00.0020.01016.69
7.2.330.0070.01016.80
7.2.320.0150.00616.79
7.2.310.0080.00816.57
7.2.300.0060.01016.49
7.2.290.0090.00816.91
7.2.250.0100.01015.04
7.2.240.0090.00915.34
7.2.230.0090.00615.23
7.2.220.0130.00314.86
7.2.210.0040.01215.08
7.2.200.0000.00914.91
7.2.190.0000.01514.96
7.2.180.0110.00714.98
7.2.170.0030.01315.15
7.2.130.0040.00716.59
7.2.120.0000.01616.97
7.2.110.0070.00416.57
7.2.100.0030.01516.76
7.2.90.0120.00616.63
7.2.80.0080.00816.41
7.2.70.0110.00316.61
7.2.60.0120.00416.77
7.2.50.0120.00416.72
7.2.40.0040.00716.75
7.2.30.0090.00316.71
7.2.20.0060.01216.71
7.2.10.0090.00916.80
7.2.00.0130.00318.20
7.1.330.0000.01515.74
7.1.320.0060.00615.90
7.1.310.0000.00915.68
7.1.300.0030.01315.57
7.1.290.0060.00915.77
7.1.280.0060.00315.84
7.1.270.0090.00615.86
7.1.260.0030.01315.59
7.1.250.0080.00515.79
7.1.200.0060.00915.75
7.1.100.0000.01518.25
7.1.70.0030.01016.91
7.1.60.0090.01319.32
7.1.50.0110.01116.90
7.1.00.0070.07322.46
7.0.200.0000.00816.51
7.0.140.0070.06721.97
7.0.60.0000.09020.02
7.0.50.0030.06317.82
7.0.40.0100.08320.11
7.0.30.0270.05020.23
7.0.20.0300.08720.17
7.0.10.0230.08720.31
7.0.00.0000.04720.06
5.6.280.0000.07720.87
5.6.210.0130.08020.53
5.6.200.0030.08318.23
5.6.190.0130.08720.58
5.6.180.0230.04320.61
5.6.170.0200.04720.48
5.6.160.0070.08320.54
5.6.150.0070.05718.25
5.6.140.0070.03718.23
5.6.130.0030.04018.17
5.6.120.0100.04721.02
5.6.110.0030.04721.01
5.6.100.0070.08721.02
5.6.90.0130.07321.01
5.6.80.0170.06320.39
5.6.70.3170.04320.45
5.5.350.0170.07320.44
5.5.340.0100.08017.98
5.5.330.0000.05720.27
5.5.320.0400.07720.23
5.5.310.0530.05720.23
5.5.300.0030.08717.95
5.5.290.0100.04017.93
5.5.280.0130.05020.89
5.5.270.0130.06020.88
5.5.260.0100.08320.78
5.5.250.0000.08720.72
5.5.240.0230.05720.27
5.4.450.0130.05319.31
5.4.440.0730.05719.55
5.4.430.0900.07719.55
5.4.420.0670.00019.53
5.4.410.0670.00019.35
5.4.400.0630.00019.39
5.4.390.0630.00018.98
5.4.380.0630.00019.04
5.4.370.0630.00019.14
5.4.360.0630.00019.07
5.4.350.0630.00019.04
5.4.340.0050.03612.02
5.4.320.0080.03412.51
5.4.310.0060.03712.50
5.4.300.0060.03612.51
5.4.290.0090.04712.50
5.4.280.0080.03212.40
5.4.270.0060.03512.39
5.4.260.0070.03612.40
5.4.250.0040.03912.40
5.4.240.0090.03412.40
5.4.230.0070.03612.39
5.4.220.0020.04012.39
5.4.210.0080.03312.39
5.4.200.0080.03612.39
5.4.190.0040.03712.39
5.4.180.0060.03512.38
5.4.170.0050.03612.40
5.4.160.0070.03412.39
5.4.150.0070.03412.39
5.4.140.0070.03512.07
5.4.130.0050.03912.06
5.4.120.0130.03212.02
5.4.110.0060.03812.02
5.4.100.0050.04112.02
5.4.90.0130.04112.02
5.4.80.0110.03812.02
5.4.70.0100.04212.01
5.4.60.0030.03712.02
5.4.50.0040.03712.01
5.4.40.0020.03812.00
5.4.30.0100.04012.00
5.4.20.0160.07012.00
5.4.10.0060.04612.00
5.4.00.0080.03511.48
5.3.290.0050.04012.80
5.3.280.0080.03612.71
5.3.270.0100.04612.73
5.3.260.0060.05212.72
5.3.250.0140.04412.72
5.3.240.0100.04412.71
5.3.230.0070.04512.70
5.3.220.0060.04412.68
5.3.210.0100.05012.68
5.3.200.0050.05212.68
5.3.190.0060.04112.67
5.3.180.0050.04412.67
5.3.170.0040.03812.67
5.3.160.0070.03612.68
5.3.150.0040.04012.67
5.3.140.0050.03712.66
5.3.130.0080.03612.66
5.3.120.0080.03612.66
5.3.110.0070.03712.66
5.3.100.0070.03612.13
5.3.90.0060.03512.11
5.3.80.0070.03512.10
5.3.70.0070.03512.10
5.3.60.0050.03812.09
5.3.50.0070.03512.04
5.3.40.0060.03712.04
5.3.30.0070.03411.99
5.3.20.0040.03711.77
5.3.10.0040.03711.74
5.3.00.0050.03711.73
5.2.170.0050.0309.23
5.2.160.0050.0299.22
5.2.150.0030.0329.22
5.2.140.0020.0339.21
5.2.130.0050.0289.18
5.2.120.0080.0259.18
5.2.110.0050.0339.19
5.2.100.0060.0279.19
5.2.90.0050.0289.18
5.2.80.0030.0319.18
5.2.70.0040.0329.19
5.2.60.0050.0299.13
5.2.50.0070.0279.10
5.2.40.0020.0329.07
5.2.30.0070.0289.06
5.2.20.0080.0269.04
5.2.10.0040.0298.95
5.2.00.0030.0308.82
5.1.60.0040.0248.10
5.1.50.0060.0238.09
5.1.40.0040.0258.07
5.1.30.0080.0238.42
5.1.20.0060.0268.45
5.1.10.0030.0278.17
5.1.00.0040.0268.17
5.0.50.0040.0216.64
5.0.40.0030.0196.51
5.0.30.0060.0296.31
5.0.20.0040.0196.28
5.0.10.0060.0176.26
5.0.00.0030.0306.25
4.4.90.0020.0164.78
4.4.80.0020.0164.75
4.4.70.0030.0154.75
4.4.60.0020.0164.76
4.4.50.0020.0174.77
4.4.40.0030.0254.71
4.4.30.0050.0134.76
4.4.20.0020.0164.85
4.4.10.0010.0174.85
4.4.00.0040.0254.76
4.3.110.0070.0184.67
4.3.100.0030.0214.66
4.3.90.0010.0174.64
4.3.80.0020.0254.58
4.3.70.0040.0164.63
4.3.60.0020.0154.63
4.3.50.0010.0184.63
4.3.40.0040.0254.54
4.3.30.0010.0203.28
4.3.20.0030.0213.26
4.3.10.0030.0203.22
4.3.00.0070.0237.08

preferences:
60.52 ms | 400 KiB | 5 Q