3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classType = [ ["class" => "1", "type" => "A"], ["class" => "2", "type" => "A"], ["class" => "3", "type" => "B"] ]; $clollege['studentDetails'] = [ ["grade" => "2", "hobbies" => ["A" , "B"] ], ["grade" => "2", "hobbies" => ["A" ] ], ["grade" => "3", "hobbies" => [ "C" ] ] ]; $classType = array_column($classType, 'type', "class"); array_walk($clollege['studentDetails'], function(&$item) use($classType) { $item['type'] = $classType[$item['grade']]; }); echo '<pre>', print_r($clollege['studentDetails']);

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.5.00.0150.00619.83
8.4.150.0030.00014.05
8.4.140.0140.00717.66
8.4.130.0140.00617.61
8.4.120.0110.00820.49
8.4.110.0090.00922.41
8.4.100.0110.00917.59
8.4.90.0110.00918.86
8.4.80.0050.00518.04
8.4.70.0100.01018.19
8.4.60.0160.00418.82
8.4.50.0100.00919.66
8.4.40.0130.00620.43
8.4.30.0080.00020.39
8.4.20.0190.00020.93
8.4.10.0030.00617.92
8.3.280.0160.00520.03
8.3.270.0110.00816.61
8.3.260.0100.00816.76
8.3.250.0080.00818.85
8.3.240.0080.00616.61
8.3.230.0040.00416.56
8.3.220.0070.01217.35
8.3.210.0090.01016.86
8.3.200.0040.00416.61
8.3.190.0100.00817.12
8.3.180.0030.00517.10
8.3.170.0120.00616.55
8.3.160.0070.01116.60
8.3.150.0040.00416.58
8.3.140.0090.00620.71
8.3.130.0170.00318.61
8.3.120.0060.01318.76
8.3.110.0000.00816.78
8.3.100.0000.00716.61
8.3.90.0190.00016.73
8.3.80.0060.00316.50
8.3.70.0070.01416.58
8.3.60.0090.01218.43
8.3.50.0110.00921.27
8.3.40.0120.00618.71
8.3.30.0140.00718.71
8.3.20.0070.00021.80
8.3.10.0050.00322.11
8.3.00.0080.00021.88
8.2.290.0110.00920.68
8.2.280.0110.00818.72
8.2.270.0110.00717.39
8.2.260.0080.00017.09
8.2.250.0040.00418.27
8.2.240.0060.00917.04
8.2.230.0030.00620.94
8.2.220.0070.00337.54
8.2.210.0130.00726.77
8.2.200.0060.00318.41
8.2.190.0120.00316.75
8.2.180.0070.00725.92
8.2.170.0040.01122.96
8.2.160.0000.01419.36
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.01126.16
8.2.120.0050.00319.66
8.2.110.0090.00021.02
8.2.100.0040.00717.84
8.2.90.0040.00418.16
8.2.80.0090.00017.97
8.2.70.0030.00518.04
8.2.60.0090.00017.68
8.2.50.0000.00818.07
8.2.40.0030.00519.88
8.2.30.0040.00419.80
8.2.20.0000.00718.16
8.2.10.0000.00719.20
8.2.00.0000.00819.30
8.1.330.0120.00621.89
8.1.320.0090.01016.41
8.1.310.0100.00718.63
8.1.300.0150.00417.78
8.1.290.0000.00918.88
8.1.280.0100.01025.92
8.1.270.0060.00323.83
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0100.00020.87
8.1.230.0080.00320.95
8.1.220.0080.00017.74
8.1.210.0080.00018.92
8.1.200.0080.00017.48
8.1.190.0070.00317.36
8.1.180.0060.00318.10
8.1.170.0000.00818.64
8.1.160.0040.00418.86
8.1.150.0060.00318.79
8.1.140.0040.00420.88
8.1.130.0030.00320.07
8.1.120.0030.00517.43
8.1.110.0030.00517.47
8.1.100.0080.00317.46
8.1.90.0000.00917.47
8.1.80.0000.00817.46
8.1.70.0000.00717.39
8.1.60.0040.00417.63
8.1.50.0070.00017.48
8.1.40.0030.00517.59
8.1.30.0050.00317.75
8.1.20.0000.00917.71
8.1.10.0090.00017.62
8.1.00.0070.00017.56
8.0.300.0050.00219.95
8.0.290.0040.00416.75
8.0.280.0000.00718.50
8.0.270.0000.00716.81
8.0.260.0000.00620.07
8.0.250.0000.00716.96
8.0.240.0030.00616.85
8.0.230.0050.00216.81
8.0.220.0070.00016.80
8.0.210.0000.00716.80
8.0.200.0030.00716.95
8.0.190.0050.00316.96
8.0.180.0000.00716.88
8.0.170.0060.00316.89
8.0.160.0040.00416.90
8.0.150.0000.00716.85
8.0.140.0030.00316.84
8.0.130.0000.00513.27
8.0.120.0040.00416.88
8.0.110.0000.00716.86
8.0.100.0000.00716.72
8.0.90.0030.00516.91
8.0.80.0100.00716.89
8.0.70.0050.00216.95
8.0.60.0040.00416.77
8.0.50.0040.00416.93
8.0.30.0090.01117.13
8.0.20.0100.01017.27
8.0.10.0000.00816.90
8.0.00.0070.01216.77
7.4.330.0000.00615.55
7.4.320.0070.00016.52
7.4.300.0030.00316.45
7.4.290.0050.00216.65
7.4.280.0070.00316.45
7.4.270.0030.00316.61
7.4.260.0030.00316.63
7.4.250.0000.00816.46
7.4.240.0070.00016.49
7.4.230.0030.00316.62
7.4.220.0030.00316.25
7.4.210.0090.00716.51
7.4.200.0070.00016.34
7.4.140.0070.01717.86
7.4.130.0100.01016.49
7.4.120.0110.00716.64
7.4.110.0060.01216.50
7.4.100.0040.01316.77
7.4.90.0110.00616.60
7.4.80.0090.00919.39
7.4.70.0060.01116.39
7.4.60.0120.01116.45
7.4.50.0100.01016.45
7.4.40.0120.00616.23
7.4.30.0120.00516.38
7.4.20.0100.01016.17
7.4.10.0080.00816.36
7.4.00.0060.01015.46
7.3.330.0080.00016.24
7.3.320.0030.00313.30
7.3.310.0030.00316.21
7.3.300.0000.00616.28
7.3.290.0070.00016.32
7.3.280.0140.00616.33
7.3.260.0120.00716.42
7.3.240.0090.00916.43
7.3.230.0050.01416.33
7.3.210.0150.00316.61
7.3.200.0140.00316.67
7.3.190.0040.01216.30
7.3.180.0070.01516.37
7.3.170.0120.00716.32
7.3.160.0080.00816.55
7.3.150.0070.01216.53
7.3.140.0080.00816.24
7.3.130.0100.00716.34
7.3.120.0070.01015.70
7.3.110.0050.01315.64
7.3.100.0100.00515.62
7.3.90.0070.00815.52
7.3.80.0120.00415.29
7.3.70.0070.00815.18
7.3.60.0060.00815.30
7.3.50.0060.00915.38
7.3.40.0070.00815.33
7.3.30.0070.00915.30
7.3.20.0100.00816.29
7.3.10.0120.00616.22
7.3.00.0100.00616.16
7.2.330.0080.00916.91
7.2.320.0070.01316.88
7.2.310.0130.01216.40
7.2.300.0110.00916.70
7.2.290.0050.01316.59
7.2.280.0150.00316.53
7.2.270.0090.01016.36
7.2.260.0100.00716.58
7.2.250.0080.01015.76
7.2.240.0110.00815.79
7.2.230.0070.01015.96
7.2.220.0060.01015.82
7.2.210.0080.00815.48
7.2.200.0070.00915.65
7.2.190.0070.00815.61
7.2.180.0050.00815.50
7.2.170.0110.00515.52
7.2.160.0110.00815.82
7.2.150.0120.00916.27
7.2.140.0110.01016.32
7.2.130.0130.00816.29
7.2.120.0110.00816.29
7.2.110.0120.00716.15
7.2.100.0180.01216.22
7.2.90.0100.01016.33
7.2.80.0090.01116.15
7.2.70.0090.00816.33
7.2.60.0100.00916.38
7.2.50.0100.01116.34
7.2.40.0140.00516.31
7.2.30.0130.00716.42
7.2.20.0070.01216.22
7.2.10.0140.00916.42
7.2.00.0120.01016.30
7.1.330.0130.00915.63
7.1.320.0100.01015.67
7.1.310.0100.01015.25
7.1.300.0180.00515.33
7.1.290.0110.00815.31
7.1.280.0160.00715.32
7.1.270.0160.00915.32
7.1.260.0120.00915.38
7.1.250.0230.00615.17
7.1.240.0260.00815.02
7.1.230.0160.01114.90
7.1.220.0210.00615.00
7.1.210.0170.01314.94
7.1.200.0310.00814.93
7.1.190.0210.00614.82
7.1.180.0190.00915.00
7.1.170.0220.00815.01
7.1.160.0170.01014.87
7.1.150.0250.00415.08
7.1.140.0240.00814.90
7.1.130.0160.00914.87
7.1.120.0220.00515.05
7.1.110.0330.01015.06
7.1.100.0230.00615.00
7.1.90.0200.00814.96
7.1.80.0160.00815.10
7.1.70.0160.01114.86
7.1.60.0250.00414.90
7.1.50.0230.00715.01
7.1.40.0300.01115.05
7.1.30.0220.00615.09
7.1.20.0160.00914.91
7.1.10.0200.00815.00
7.1.00.0240.00715.01

preferences:
61.95 ms | 403 KiB | 5 Q