3v4l.org

run code in 300+ PHP versions simultaneously
<?php $config = ['legendaryName' => 'legendary_name']; $data = ['legendary_name' => 'The Hammer']; class Warrior { use DbHydrate; private $legendaryName; } trait DbHydrate { public function hydrate($config, $data) { foreach($config as $attributeName => $column) { if(property_exists($this, $attributeName)) { $this->{$attributeName} = $data[$column]; } else { throw new \Exception(sprintf('The property %s does not exists in %s', $attributeName, self::class)); } } } } $legendaryWarrior = new Warrior; $legendaryWarrior->hydrate($config, $data); var_dump($legendaryWarrior); $config = ['classicalName' => 'classical_name']; $data = ['classical_name' => 'John']; $testWarrior = new Warrior; $testWarrior->hydrate($config, $data); var_dump($testWarrior);

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.0120.00918.43
8.3.50.0180.00418.19
8.3.40.0140.00419.02
8.3.30.0110.00318.63
8.3.20.0040.00420.20
8.3.10.0040.00423.57
8.3.00.0060.00617.80
8.2.180.0150.00418.37
8.2.170.0070.01122.96
8.2.160.0170.00020.35
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0020.00521.12
8.2.110.0030.00722.20
8.2.100.0090.00317.84
8.2.90.0040.00418.03
8.2.80.0040.00419.45
8.2.70.0040.00418.05
8.2.60.0080.00018.04
8.2.50.0000.00818.10
8.2.40.0030.00720.59
8.2.30.0040.00419.37
8.2.20.0030.00618.13
8.2.10.0000.00818.08
8.2.00.0000.00718.29
8.1.280.0090.00925.92
8.1.270.0000.00822.19
8.1.260.0060.00326.35
8.1.250.0020.00528.09
8.1.240.0090.00022.60
8.1.230.0080.00320.97
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0090.00017.35
8.1.190.0050.00317.23
8.1.180.0030.00618.10
8.1.170.0050.00318.59
8.1.160.0000.00718.81
8.1.150.0050.00220.27
8.1.140.0000.00717.76
8.1.130.0000.00819.03
8.1.120.0040.00417.50
8.1.110.0000.00817.35
8.1.100.0030.00517.44
8.1.90.0000.00717.39
8.1.80.0040.00417.49
8.1.70.0030.00317.41
8.1.60.0000.00817.54
8.1.50.0030.00617.37
8.1.40.0040.00417.40
8.1.30.0040.00417.59
8.1.20.0090.00017.59
8.1.10.0040.00417.54
8.1.00.0080.00017.51
8.0.300.0040.00421.95
8.0.290.0040.00416.75
8.0.280.0080.00018.45
8.0.270.0000.00717.14
8.0.260.0070.00016.79
8.0.250.0070.00017.04
8.0.240.0030.00317.04
8.0.230.0070.00017.01
8.0.220.0070.00016.95
8.0.210.0030.00316.84
8.0.200.0070.00017.03
8.0.190.0090.00016.98
8.0.180.0040.00416.93
8.0.170.0050.00316.87
8.0.160.0040.00316.87
8.0.150.0010.00716.90
8.0.140.0000.00816.90
8.0.130.0000.00613.35
8.0.120.0070.00016.81
8.0.110.0000.00716.89
8.0.100.0080.00016.89
8.0.90.0000.00816.75
8.0.80.0100.01017.02
8.0.70.0040.00417.06
8.0.60.0070.00016.98
8.0.50.0040.00417.02
8.0.30.0110.00417.22
8.0.20.0110.00917.40
8.0.10.0050.00317.13
8.0.00.0110.00816.99
7.4.330.0020.00215.55
7.4.320.0040.00416.46
7.4.300.0000.00616.52
7.4.290.0040.00416.60
7.4.280.0040.00416.45
7.4.270.0070.00016.36
7.4.260.0070.00016.63
7.4.250.0000.00716.55
7.4.240.0040.00416.62
7.4.230.0030.00316.70
7.4.220.0000.00716.34
7.4.210.0120.00616.56
7.4.200.0040.00416.37
7.4.160.0120.00616.41
7.4.150.0040.01517.40
7.4.140.0130.00717.86
7.4.130.0090.00916.51
7.4.120.0120.00516.58
7.4.110.0100.00716.45
7.4.100.0100.00716.64
7.4.90.0070.01016.44
7.4.80.0170.00719.39
7.4.70.0130.00716.55
7.4.60.0110.00716.44
7.4.50.0060.00616.48
7.4.40.0170.00316.58
7.4.00.0030.01314.88
7.3.330.0000.00613.38
7.3.320.0030.00313.44
7.3.310.0000.00716.25
7.3.300.0050.00516.34
7.3.290.0100.00716.36
7.3.280.0070.00916.37
7.3.270.0080.01117.40
7.3.260.0100.00816.47
7.3.240.0110.00616.50
7.3.230.0070.01016.41
7.3.210.0130.00316.68
7.3.200.0130.00316.70
7.3.190.0090.00616.42
7.3.180.0130.00616.36
7.3.170.0100.01016.43
7.3.160.0050.01216.33
7.3.120.0070.00714.87
7.3.110.0140.00414.71
7.3.100.0130.00314.92
7.3.90.0000.01314.71
7.3.80.0040.01114.63
7.3.70.0120.00414.73
7.3.60.0040.00414.80
7.3.50.0000.01214.88
7.3.40.0030.00714.80
7.3.30.0080.00414.85
7.3.20.0060.00916.85
7.3.10.0070.00316.51
7.3.00.0090.00916.67
7.2.330.0150.00316.83
7.2.320.0170.00616.68
7.2.310.0090.00916.70
7.2.300.0170.00516.78
7.2.290.0100.00616.58
7.2.250.0000.01815.05
7.2.240.0070.01015.16
7.2.230.0030.01515.15
7.2.220.0050.00815.12
7.2.210.0100.00615.11
7.2.200.0040.01115.11
7.2.190.0070.01114.91
7.2.180.0000.01115.15
7.2.170.0050.00515.12
7.2.160.0100.00714.80
7.2.150.0030.00916.84
7.2.140.0080.00416.86
7.2.130.0090.00917.09
7.2.120.0120.00316.92
7.2.110.0120.00316.93
7.2.100.0040.01116.59
7.2.90.0000.01316.96
7.2.80.0070.01016.91
7.2.70.0070.01316.82
7.2.60.0090.00517.00
7.2.50.0090.00316.88
7.2.40.0070.01016.81
7.2.30.0090.00617.02
7.2.20.0260.00817.24
7.2.10.0220.00817.38
7.2.00.0270.01117.40
7.1.330.0090.00915.92
7.1.320.0070.01015.70
7.1.310.0030.00615.41
7.1.300.0040.00415.66
7.1.290.0060.00315.73
7.1.280.0060.00915.62
7.1.270.0060.00315.78
7.1.260.0000.01415.80
7.1.250.0000.00916.05
7.1.240.0030.01015.81
7.1.230.0090.00015.87
7.1.220.0060.00915.89
7.1.210.0040.00815.73
7.1.200.0050.00915.80
7.1.190.0030.01415.68
7.1.180.0060.00915.93
7.1.170.0000.01415.68
7.1.160.0090.00915.81
7.1.150.0040.00715.77
7.1.140.0350.01016.28
7.1.130.0210.01316.19
7.1.120.0230.00716.41
7.1.110.0170.01116.07
7.1.100.0290.00516.07
7.1.90.0330.01115.87
7.1.80.0250.00515.99
7.1.70.0310.00315.49
7.1.60.0420.00824.54
7.1.50.0230.01124.27
7.1.40.0290.00824.30
7.1.30.0300.01324.13
7.1.20.0260.01024.36
7.1.10.0170.01015.41
7.1.00.0170.01015.24
7.0.330.0070.00715.46
7.0.320.0090.00615.48
7.0.310.0120.00615.21
7.0.300.0040.00715.33
7.0.290.0140.00015.38
7.0.280.0060.00315.17
7.0.270.0000.01515.46
7.0.260.0030.01315.47
7.0.250.0080.00815.14
7.0.240.0080.00415.30
7.0.230.0100.00315.50
7.0.220.0030.01315.23
7.0.210.0100.00715.52
7.0.200.0040.00815.10
7.0.190.0030.00915.11
7.0.180.0090.00615.53
7.0.170.0060.00615.31
7.0.160.0070.00715.47
7.0.150.0050.00515.33
7.0.140.0000.01115.19
7.0.130.0100.00315.53
7.0.120.0060.00315.49
7.0.110.0060.00615.09
7.0.100.0100.00015.50
7.0.90.0060.00315.33
7.0.80.0000.01115.17
7.0.70.0000.00915.45
7.0.60.0050.00515.48
7.0.50.0060.00315.45
7.0.40.0100.00013.27
7.0.30.0060.00613.64
7.0.20.0100.00713.63
7.0.10.0040.00813.60
7.0.00.0040.00813.50
5.6.400.0150.00014.40
5.6.390.0100.00314.34
5.6.380.0040.00714.45
5.6.370.0100.00714.29
5.6.360.0080.00714.43
5.6.350.0070.00714.04
5.6.340.0100.00314.35
5.6.330.0120.00314.33
5.6.320.0030.00714.34
5.6.310.0110.00614.43
5.6.300.0070.00314.58
5.6.290.0040.00814.28
5.6.280.0120.00314.41
5.6.270.0030.00714.32
5.6.260.0000.01114.42
5.6.250.0030.01314.43
5.6.240.0090.00614.43
5.6.230.0060.00614.13
5.6.220.0140.00014.34
5.6.210.0040.00714.48
5.6.200.0100.00714.68
5.6.190.0000.01014.48
5.6.180.0000.01414.39
5.6.170.0030.01214.43
5.6.160.0030.01314.18
5.6.150.0120.00314.29
5.6.140.0090.00614.13
5.6.130.0090.00614.37
5.6.120.0030.01414.24
5.6.110.0100.00714.52
5.6.100.0000.01514.52
5.6.90.0100.00714.60
5.6.80.0150.00014.22
5.6.70.0030.01314.15
5.6.60.0120.00314.16
5.6.50.0060.00914.30
5.6.40.0060.00614.26
5.6.30.0040.01114.44
5.6.20.0100.00714.48
5.6.10.0070.01014.38
5.6.00.0030.01314.57

preferences:
48.39 ms | 400 KiB | 5 Q