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){ $attribute = $this->{$attributeName}; var_dump($attribute); $this->{$attributeName} = $data[$column]; } } } $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.0090.00918.16
8.3.40.0070.01118.60
8.3.30.0060.01218.88
8.3.20.0040.00420.51
8.3.10.0040.00423.53
8.3.00.0000.01017.80
8.2.180.0140.00718.37
8.2.170.0070.00722.96
8.2.160.0130.00020.44
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00021.18
8.2.110.0100.00020.69
8.2.100.0120.00318.03
8.2.90.0080.00017.84
8.2.80.0000.00920.51
8.2.70.0040.00417.93
8.2.60.0000.00818.16
8.2.50.0000.00818.34
8.2.40.0050.00220.55
8.2.30.0000.00819.22
8.2.20.0060.00318.05
8.2.10.0000.00718.19
8.2.00.0000.00718.36
8.1.280.0090.00925.92
8.1.270.0070.00022.05
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00722.43
8.1.230.0040.00720.96
8.1.220.0000.00917.91
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0030.00617.10
8.1.180.0000.00718.10
8.1.170.0080.00018.56
8.1.160.0000.00718.82
8.1.150.0030.00520.26
8.1.140.0000.00717.73
8.1.130.0000.00719.04
8.1.120.0030.00317.36
8.1.110.0000.00717.39
8.1.100.0040.00417.36
8.1.90.0040.00417.45
8.1.80.0040.00417.36
8.1.70.0040.00417.45
8.1.60.0020.00517.57
8.1.50.0030.00617.50
8.1.40.0000.00817.38
8.1.30.0000.00817.69
8.1.20.0030.00617.58
8.1.10.0040.00417.54
8.1.00.0040.00417.52
8.0.300.0070.00021.96
8.0.290.0050.00316.75
8.0.280.0030.00318.44
8.0.270.0000.00717.32
8.0.260.0070.00016.94
8.0.250.0000.00717.00
8.0.240.0030.00317.02
8.0.230.0030.00317.06
8.0.220.0000.00716.99
8.0.210.0030.00316.95
8.0.200.0000.00717.02
8.0.190.0080.00016.85
8.0.180.0000.00716.92
8.0.170.0000.00816.96
8.0.160.0040.00416.91
8.0.150.0000.00716.88
8.0.140.0030.00516.80
8.0.130.0030.00313.38
8.0.120.0040.00416.81
8.0.110.0000.01016.95
8.0.100.0000.00716.81
8.0.90.0000.00816.89
8.0.80.0130.01016.91
8.0.70.0040.00416.95
8.0.60.0070.00016.91
8.0.50.0070.00016.90
8.0.30.0110.00617.12
8.0.20.0110.00917.40
8.0.10.0000.00817.02
8.0.00.0130.00716.77
7.4.330.0000.00615.55
7.4.320.0070.00016.52
7.4.300.0060.00016.61
7.4.290.0000.00816.58
7.4.280.0000.00816.57
7.4.270.0070.00016.39
7.4.260.0030.00316.54
7.4.250.0080.00016.57
7.4.240.0070.00016.48
7.4.230.0030.00316.34
7.4.220.0000.00916.67
7.4.210.0060.01016.59
7.4.200.0000.00716.47
7.4.160.0150.00216.53
7.4.150.0060.01217.40
7.4.140.0120.00617.86
7.4.130.0070.01016.52
7.4.120.0110.01016.54
7.4.110.0040.01216.54
7.4.100.0080.00816.41
7.4.90.0140.00316.38
7.4.80.0070.01719.39
7.4.70.0090.00916.45
7.4.60.0060.01116.54
7.4.50.0090.00616.22
7.4.40.0070.01016.33
7.4.00.0090.00615.06
7.3.330.0030.00313.44
7.3.320.0000.00513.48
7.3.310.0000.00716.38
7.3.300.0000.00616.28
7.3.290.0000.01416.33
7.3.280.0020.01516.35
7.3.270.0120.00917.40
7.3.260.0090.01016.44
7.3.240.0080.01016.46
7.3.230.0110.00716.48
7.3.210.0100.00916.44
7.3.200.0060.00916.47
7.3.190.0080.01116.37
7.3.180.0030.01616.36
7.3.170.0120.00616.39
7.3.160.0100.00616.50
7.3.10.0120.00316.62
7.3.00.0030.01116.54
7.2.330.0150.00316.79
7.2.320.0140.00416.78
7.2.310.0040.01216.48
7.2.300.0070.01716.60
7.2.290.0030.01316.74
7.2.130.0090.00617.05
7.2.120.0030.01016.79
7.2.110.0040.00516.89
7.2.100.0050.01116.92
7.2.90.0050.00716.83
7.2.80.0030.01216.80
7.2.70.0090.00416.93
7.2.60.0070.00516.95
7.2.50.0100.00516.86
7.2.40.0050.00816.92
7.2.30.0060.00816.82
7.2.20.0200.00517.27
7.2.10.0160.00917.10
7.2.00.0160.00717.01
7.1.250.0070.00715.50
7.1.240.0130.00315.71
7.1.230.0030.00915.95
7.1.220.0040.00415.74
7.1.210.0030.00915.66
7.1.200.0110.00415.86
7.1.190.0070.00415.78
7.1.180.0040.00715.70
7.1.170.0030.01215.41
7.1.160.0070.00315.68
7.1.150.0030.00815.65
7.1.140.0360.00416.35
7.1.130.0270.01116.23
7.1.120.0270.00816.18
7.1.110.0230.00915.87
7.1.100.0190.00515.74
7.1.90.0310.00515.83
7.1.80.0400.00915.81
7.1.70.0250.00915.51
7.1.60.0220.00824.28
7.1.50.0320.00924.19
7.1.40.0290.01124.17
7.1.30.0330.00924.14
7.1.20.0370.00324.33
7.1.10.0230.00715.32
7.1.00.0240.00515.15
7.0.330.0050.00315.30
5.6.380.0070.00314.43

preferences:
44.47 ms | 401 KiB | 5 Q