3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Student { public $studentnummer; public $voornaam; } $apiResult = [ 'firstName' => 'Barry', 'sid' => 'S123', ]; $map = [ 'firstName' => 'voornaam', 'sid' => 'studentnummer', ]; $student = new Student; foreach ($apiResult as $key => $value) { if (isset($map[$key])) { $student->{$map[$key]} = $value; } } print_r($student);

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.4.130.0090.00719.02
8.4.120.0110.00724.15
8.4.110.0120.00822.24
8.4.100.0100.00718.70
8.4.90.0120.00818.83
8.4.80.0120.00818.62
8.4.70.0130.00817.75
8.4.60.0120.00718.87
8.4.50.0100.01018.84
8.4.40.0070.01419.38
8.4.30.0070.00317.72
8.4.20.0130.00617.55
8.4.10.0070.00417.88
8.3.260.0110.00816.83
8.3.250.0120.00518.99
8.3.240.0110.00817.12
8.3.230.0080.00716.77
8.3.220.0030.00419.04
8.3.210.0090.00716.51
8.3.200.0150.00616.75
8.3.190.0120.00617.31
8.3.180.0110.00816.79
8.3.170.0100.01020.43
8.3.160.0060.01216.98
8.3.150.0030.01417.19
8.3.140.0080.00018.52
8.3.130.0060.00316.55
8.3.120.0040.01120.49
8.3.110.0090.00920.94
8.3.100.0060.00924.06
8.3.90.0050.00326.77
8.3.80.0070.00318.43
8.3.70.0100.00716.50
8.3.60.0030.01716.63
8.3.50.0150.00521.13
8.3.40.0140.00318.97
8.3.30.0110.00418.51
8.3.20.0030.00620.48
8.3.10.0040.00421.76
8.3.00.0000.00819.13
8.2.290.0080.01020.66
8.2.280.0110.00720.54
8.2.270.0040.01418.68
8.2.260.0040.00416.50
8.2.250.0000.00816.82
8.2.240.0060.00317.22
8.2.230.0090.00422.58
8.2.220.0090.00037.54
8.2.210.0070.01326.77
8.2.200.0060.00316.63
8.2.190.0070.00716.58
8.2.180.0140.00716.75
8.2.170.0110.00722.96
8.2.160.0090.00420.52
8.2.150.0000.00724.18
8.2.140.0000.00724.66
8.2.130.0080.00019.83
8.2.120.0030.00526.35
8.2.110.0030.00722.25
8.2.100.0040.00718.04
8.2.90.0040.00418.34
8.2.80.0070.00217.97
8.2.70.0060.00317.63
8.2.60.0040.00417.93
8.2.50.0000.00818.16
8.2.40.0060.00320.47
8.2.30.0000.00819.28
8.2.20.0040.00418.13
8.2.10.0000.00718.00
8.2.00.0000.00717.62
8.1.330.0070.01121.88
8.1.320.0160.00416.04
8.1.310.0150.00316.92
8.1.300.0110.00319.97
8.1.290.0100.00030.84
8.1.280.0000.01425.92
8.1.270.0040.00422.11
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0080.00320.84
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0050.00517.00
8.1.190.0040.00417.11
8.1.180.0080.00018.10
8.1.170.0060.00318.49
8.1.160.0030.00618.83
8.1.150.0070.00020.28
8.1.140.0040.00419.59
8.1.130.0030.00317.70
8.1.120.0070.00017.47
8.1.110.0040.00417.40
8.1.100.0040.00417.46
8.1.90.0030.00417.31
8.1.80.0040.00417.49
8.1.70.0040.00417.36
8.1.60.0030.00617.52
8.1.50.0040.00417.50
8.1.40.0080.00017.50
8.1.30.0000.00917.65
8.1.20.0040.00417.68
8.1.10.0000.00817.58
8.1.00.0050.00217.43
8.0.300.0000.00820.27
8.0.290.0080.00016.61
8.0.280.0030.00318.38
8.0.270.0070.00017.14
8.0.260.0030.00317.26
8.0.250.0030.00316.95
8.0.240.0030.00317.00
8.0.230.0070.00016.98
8.0.220.0030.00316.93
8.0.210.0030.00316.81
8.0.200.0030.00316.88
8.0.190.0000.01116.96
8.0.180.0080.00016.78
8.0.170.0070.00016.95
8.0.160.0040.00416.99
8.0.150.0070.00016.84
8.0.140.0040.00416.77
8.0.130.0040.00413.25
8.0.120.0040.00416.76
8.0.110.0000.00716.83
8.0.100.0050.00316.91
8.0.90.0000.00816.75
8.0.80.0090.00616.84
8.0.70.0040.00416.78
8.0.60.0000.00716.80
8.0.50.0000.00716.96
8.0.30.0090.00817.15
8.0.20.0120.00817.40
8.0.10.0040.00416.83
8.0.00.0140.00916.83
7.4.330.0030.00315.55
7.4.320.0000.00616.51
7.4.300.0070.00016.61
7.4.290.0030.00316.60
7.4.280.0040.00416.51
7.4.270.0050.00316.56
7.4.260.0030.00616.52
7.4.250.0050.00316.52
7.4.240.0030.00316.66
7.4.230.0040.00416.70
7.4.220.0100.00716.62
7.4.210.0090.01016.65
7.4.200.0000.00716.53
7.4.160.0020.01316.56
7.4.150.0060.01217.40
7.4.140.0120.00617.86
7.4.130.0080.01016.50
7.4.120.0090.00916.56
7.4.110.0100.00716.57
7.4.100.0140.00716.42
7.4.90.0170.00816.45
7.4.80.0070.01019.39
7.4.70.0100.00716.45
7.4.60.0140.00416.61
7.4.50.0000.01316.45
7.4.40.0110.01116.56
7.4.30.0100.00716.43
7.4.00.0070.01015.07
7.3.330.0010.00613.12
7.3.320.0060.00013.15
7.3.310.0030.00316.07
7.3.300.0040.00316.32
7.3.290.0040.00416.34
7.3.280.0100.01116.27
7.3.270.0090.00817.40
7.3.260.0070.01116.53
7.3.250.0100.00916.38
7.3.240.0110.00916.38
7.3.230.0120.00816.46
7.3.210.0130.00316.48
7.3.200.0090.01216.24
7.3.190.0070.01116.48
7.3.180.0150.00316.35
7.3.170.0160.00016.37
7.3.160.0130.00616.64
7.2.330.0100.00716.77
7.2.320.0190.00416.79
7.2.310.0130.00316.64
7.2.300.0150.01116.75
7.2.290.0120.00816.47
7.2.60.0040.00416.89
7.2.00.0190.00319.22
7.1.200.0040.01115.75
7.1.70.0070.01317.29
7.1.60.0030.00917.09
7.1.00.0070.07322.57
7.0.200.0170.00314.97
7.0.130.0100.06022.16
7.0.120.0070.05722.10
7.0.110.0130.05322.03
7.0.100.0030.06022.04
7.0.90.0070.06022.20
7.0.80.0130.06022.05
7.0.70.0030.06722.16
7.0.60.0170.05322.14
7.0.50.0100.05722.16
7.0.40.0070.05722.09
7.0.30.0170.05322.15
7.0.20.0130.05322.19
7.0.10.0170.05022.11
7.0.00.0070.08022.20
5.6.270.0070.05321.09
5.6.260.0100.05721.05
5.6.250.0130.07020.89
5.6.240.0200.05020.88
5.6.230.0100.06320.97
5.6.220.0130.05720.86
5.6.210.0170.05321.05
5.6.200.0070.06720.87
5.6.190.0100.05720.85
5.6.180.0030.06321.07
5.6.170.0030.06020.92
5.6.160.0170.07021.04
5.6.150.0100.08020.75
5.6.140.0200.05321.04
5.6.130.0070.06320.83
5.6.120.0130.08021.06
5.6.110.0070.06021.08
5.6.100.0030.06021.00
5.6.90.0170.06321.02
5.6.80.0000.07020.38
5.6.70.0130.05020.39
5.6.60.0130.05720.39
5.6.50.0030.05720.18
5.6.40.0100.06020.35
5.6.30.0100.05020.34
5.6.20.0030.05720.15
5.6.10.0100.05720.40
5.6.00.0030.06020.29

preferences:
65.78 ms | 403 KiB | 5 Q