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(isset($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.0160.00618.68
8.3.50.0120.00318.06
8.3.40.0090.00618.84
8.3.30.0070.01118.78
8.3.20.0030.00620.21
8.3.10.0040.00423.48
8.3.00.0070.00317.80
8.2.180.0070.01118.23
8.2.170.0110.00722.96
8.2.160.0100.00320.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00321.05
8.2.110.0070.00322.25
8.2.100.0060.00617.94
8.2.90.0030.00617.97
8.2.80.0060.00319.27
8.2.70.0040.00418.03
8.2.60.0040.00418.01
8.2.50.0040.00418.10
8.2.40.0050.00220.34
8.2.30.0040.00419.36
8.2.20.0030.00618.12
8.2.10.0040.00418.07
8.2.00.0000.00718.37
8.1.280.0120.00625.92
8.1.270.0050.00322.19
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00623.85
8.1.230.0000.01120.97
8.1.220.0000.00817.76
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0000.00817.22
8.1.180.0060.00318.10
8.1.170.0040.00418.50
8.1.160.0060.00318.91
8.1.150.0000.00720.30
8.1.140.0000.00817.63
8.1.130.0070.00019.06
8.1.120.0000.00717.52
8.1.110.0080.00017.44
8.1.100.0080.00017.35
8.1.90.0040.00417.43
8.1.80.0040.00417.48
8.1.70.0040.00417.40
8.1.60.0040.00417.61
8.1.50.0000.00817.53
8.1.40.0080.00017.51
8.1.30.0000.00717.64
8.1.20.0000.00817.61
8.1.10.0060.00317.45
8.1.00.0030.00517.50
8.0.300.0000.00720.23
8.0.290.0040.00416.75
8.0.280.0080.00018.32
8.0.270.0030.00317.24
8.0.260.0030.00316.89
8.0.250.0030.00316.94
8.0.240.0000.00716.93
8.0.230.0000.00716.90
8.0.220.0040.00416.98
8.0.210.0070.00016.94
8.0.200.0040.00416.93
8.0.190.0040.00416.84
8.0.180.0000.00716.98
8.0.170.0030.00616.98
8.0.160.0050.00216.91
8.0.150.0040.00416.80
8.0.140.0040.00416.79
8.0.130.0030.00313.29
8.0.120.0000.00716.97
8.0.110.0000.00716.93
8.0.100.0050.00217.01
8.0.90.0030.00516.83
8.0.80.0060.00916.98
8.0.70.0040.00416.83
8.0.60.0090.00016.84
8.0.50.0000.00816.87
8.0.30.0110.00816.89
8.0.20.0110.00917.40
8.0.10.0040.00417.07
8.0.00.0080.01016.69
7.4.330.0050.00015.55
7.4.320.0070.00016.46
7.4.300.0000.00616.43
7.4.290.0030.00316.59
7.4.280.0000.00816.45
7.4.270.0000.00816.51
7.4.260.0000.00716.55
7.4.250.0000.00716.47
7.4.240.0070.00016.40
7.4.230.0040.00416.61
7.4.220.0050.00316.55
7.4.210.0040.01116.67
7.4.200.0050.00316.60
7.4.160.0090.00716.68
7.4.150.0110.00717.40
7.4.140.0050.01517.86
7.4.130.0070.01016.49
7.4.120.0080.01216.59
7.4.110.0070.01116.61
7.4.100.0070.01016.58
7.4.90.0090.01216.44
7.4.80.0150.00619.39
7.4.70.0140.00916.40
7.4.60.0120.00616.55
7.4.50.0030.01016.53
7.4.40.0080.01416.59
7.4.00.0080.00815.14
7.3.330.0050.00013.35
7.3.320.0000.00513.40
7.3.310.0000.00816.43
7.3.300.0030.00316.23
7.3.290.0070.01016.39
7.3.280.0070.00916.46
7.3.270.0040.01317.40
7.3.260.0140.00716.52
7.3.240.0150.00316.41
7.3.230.0030.01416.63
7.3.210.0100.00616.53
7.3.200.0080.00816.64
7.3.190.0090.00816.57
7.3.180.0070.01016.37
7.3.170.0070.01416.52
7.3.160.0100.00716.53
7.2.330.0040.01516.72
7.2.320.0030.01416.66
7.2.310.0080.00816.76
7.2.300.0060.01816.48
7.2.290.0060.01016.69
7.2.110.0070.00716.52
7.2.60.0070.00717.07
7.2.20.0800.01317.96
7.2.10.0360.01417.62
7.2.00.0400.01317.95
7.1.200.0030.00715.56
7.1.140.0380.01616.73
7.1.130.0470.01216.90
7.1.120.0400.00616.91
7.1.110.0490.00715.91
7.1.100.0270.01516.32
7.1.90.0880.01016.23
7.1.80.0530.01315.75
7.1.70.0480.01415.41
7.1.60.0510.02033.22
7.1.50.0460.01532.95
7.1.40.0540.01732.79
7.1.30.0540.01332.53
7.1.20.0570.01132.66
7.1.10.0500.01314.89
7.1.00.0440.01014.85

preferences:
51.81 ms | 401 KiB | 5 Q