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) { var_dump(property_exists($this,$attributeName)); $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.0210.00018.56
8.3.50.0060.00918.06
8.3.40.0070.00719.00
8.3.30.0110.00418.64
8.3.20.0030.00520.34
8.3.10.0040.00423.48
8.3.00.0030.00717.68
8.2.180.0110.00418.47
8.2.170.0100.01022.96
8.2.160.0100.00720.28
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.04
8.2.110.0060.00319.33
8.2.100.0070.00718.03
8.2.90.0000.00918.16
8.2.80.0030.00617.97
8.2.70.0080.00318.05
8.2.60.0000.00818.09
8.2.50.0030.00618.10
8.2.40.0000.00820.51
8.2.30.0000.00719.22
8.2.20.0050.00218.11
8.2.10.0040.00418.16
8.2.00.0000.00718.22
8.1.280.0130.00325.92
8.1.270.0080.00022.07
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0070.00719.23
8.1.230.0060.00620.99
8.1.220.0040.00417.78
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0000.00817.13
8.1.180.0030.00618.90
8.1.170.0000.00918.58
8.1.160.0000.00718.95
8.1.150.0040.00420.27
8.1.140.0000.00817.70
8.1.130.0050.00618.86
8.1.120.0070.00017.43
8.1.110.0030.00517.41
8.1.100.0000.00817.45
8.1.90.0080.00017.43
8.1.80.0040.00417.45
8.1.70.0030.00317.46
8.1.60.0040.00417.60
8.1.50.0000.00817.36
8.1.40.0030.00617.50
8.1.30.0040.00417.62
8.1.20.0000.00817.71
8.1.10.0000.00717.54
8.1.00.0050.00317.48
8.0.300.0070.00019.58
8.0.290.0030.00516.63
8.0.280.0040.00418.37
8.0.270.0070.00017.17
8.0.260.0040.00416.70
8.0.250.0040.00416.98
8.0.240.0000.00716.95
8.0.230.0030.00416.96
8.0.220.0030.00316.89
8.0.210.0030.00316.78
8.0.200.0030.00316.87
8.0.190.0050.00317.00
8.0.180.0040.00416.93
8.0.170.0050.00316.93
8.0.160.0000.00716.92
8.0.150.0040.00416.82
8.0.140.0000.00716.77
8.0.130.0060.00013.36
8.0.120.0070.00016.85
8.0.110.0000.00716.72
8.0.100.0040.00416.89
8.0.90.0000.00816.76
8.0.80.0110.00416.93
8.0.70.0050.00216.84
8.0.60.0040.00416.96
8.0.50.0040.00416.85
8.0.30.0120.00517.05
8.0.20.0120.01117.40
8.0.10.0000.00817.02
8.0.00.0100.00816.79
7.4.330.0050.00015.55
7.4.320.0030.00316.52
7.4.300.0000.00716.55
7.4.290.0000.00716.57
7.4.280.0040.00416.49
7.4.270.0030.00316.58
7.4.260.0000.00716.56
7.4.250.0000.00716.53
7.4.240.0070.00016.60
7.4.230.0030.00316.68
7.4.220.0040.00416.59
7.4.210.0080.00916.56
7.4.200.0030.00516.44
7.4.160.0070.00916.52
7.4.150.0090.00917.40
7.4.140.0110.00617.86
7.4.130.0060.01216.73
7.4.120.0110.00816.58
7.4.110.0160.00816.32
7.4.100.0070.01016.46
7.4.90.0080.01016.46
7.4.80.0130.00919.39
7.4.70.0170.00316.33
7.4.60.0120.00616.67
7.4.50.0000.01516.66
7.4.40.0030.01416.49
7.4.00.0100.00815.16
7.3.330.0050.00013.14
7.3.320.0050.00013.39
7.3.310.0070.00016.24
7.3.300.0070.00016.41
7.3.290.0110.00416.36
7.3.280.0050.01116.36
7.3.270.0090.00917.40
7.3.260.0130.00816.50
7.3.240.0100.00616.34
7.3.230.0030.01316.54
7.3.210.0100.00616.31
7.3.200.0130.00316.56
7.3.190.0110.00716.49
7.3.180.0160.00616.60
7.3.170.0120.00316.36
7.3.160.0080.00816.56
7.3.120.0000.01814.83
7.3.110.0070.01014.86
7.3.100.0070.00714.70
7.3.90.0040.00414.88
7.3.80.0060.00315.02
7.3.70.0060.01014.91
7.3.60.0060.00614.53
7.3.50.0030.00715.04
7.3.40.0070.00714.59
7.3.30.0000.00914.70
7.3.20.0100.00716.70
7.3.10.0070.00416.63
7.3.00.0000.01316.61
7.2.330.0160.00016.70
7.2.320.0120.00616.70
7.2.310.0090.01216.52
7.2.300.0120.00916.80
7.2.290.0000.01616.55
7.2.250.0060.01314.75
7.2.240.0030.01815.07
7.2.230.0080.00814.98
7.2.220.0070.01015.25
7.2.210.0100.00315.00
7.2.200.0090.00615.00
7.2.190.0030.01014.89
7.2.180.0030.01214.94
7.2.170.0000.00914.96
7.2.60.0120.00316.95
7.2.20.0480.01917.59
7.2.10.0540.01318.07
7.2.00.0530.01017.74
7.1.330.0080.00415.85
7.1.320.0080.00415.88
7.1.310.0030.01015.96
7.1.300.0030.00915.67
7.1.290.0070.00715.53
7.1.280.0060.00815.73
7.1.270.0060.00715.84
7.1.260.0050.00515.82
7.1.200.0000.01315.79
7.1.140.0390.00617.05
7.1.130.0470.01316.84
7.1.120.0480.01016.95
7.1.110.0490.00716.05
7.1.100.0260.01016.18
7.1.90.0320.00916.16
7.1.80.0340.00616.12
7.1.70.0290.01015.51
7.1.60.0460.00733.38
7.1.50.0440.01332.91
7.1.40.0460.01432.79
7.1.30.0730.02432.51
7.1.20.0550.00732.97
7.1.10.0340.01114.69
7.1.00.0350.01414.78

preferences:
71.83 ms | 400 KiB | 5 Q