3v4l.org

run code in 300+ PHP versions simultaneously
<?php $profiles = array( array( 'user_id' => 'fcc3d884-fbef-438a-9c86-0ad52c9b1223', 'first_name' => 'Narñia', 'middle_name' => 'Ñ', 'last_name' => 'Cruz', 'ext' => '' ), array( 'user_id' => '0d31557d-1e9f-4db3-ac0d-72e1709fe89c', 'first_name' => 'Randy', 'middle_name' => 'O', 'last_name' => 'Rocker', 'ext' => '' ), array( 'user_id' => '0f93f169-cf56-49df-a76b-7596446104c6', 'first_name' => 'Qwerty', 'middle_name' => 'K', 'last_name' => 'Asdfg', 'ext' => '' ), array( 'user_id' => '23b1f4a2-034c-43b4-96b7-3191d78cead1', 'first_name' => 'Johny', 'middle_name' => 'L', 'last_name' => 'Walker', 'ext' => '' ) ); $encoded = array( array( 'encoder_id' => '0d31557d-1e9f-4db3-ac0d-72e1709fe89c', 'fullname' => 'Randy O. Rocker', 'encoded' => 10, ), array( 'encoder_id' => '23b1f4a2-034c-43b4-96b7-3191d78cead1', 'fullname' => 'John L. Walker', 'encoded' => 20, ) ); $encoded_ids = array_column($encoded, null, 'encoder_id'); $data = array(); foreach ($profiles as $profile) { $user_id = $profile['user_id']; if (isset($encoded_ids[$user_id])) { $data[] = array('id' => $user_id, 'fullname' => $encoded_ids[$user_id]['fullname'], 'encoded' => $encoded_ids[$user_id]['encoded'] ); } else { $data[] = array('id' => $user_id, 'fullname' => "${profile['first_name']} ${profile['middle_name']} ${profile['last_name']}", 'encoded' => 0 ); } } usort($data, function ($a, $b) { return $b['encoded'] - $a['encoded'];}); print_r($data);

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.10.0060.00322.16
8.3.140.0030.00518.89
8.3.130.0050.00316.71
8.3.120.0060.01018.72
8.3.110.0070.00320.94
8.3.100.0050.00324.06
8.3.90.0090.00026.77
8.3.80.0030.00616.88
8.3.70.0180.00016.88
8.3.60.0080.00818.68
8.3.50.0080.00824.58
8.3.40.0170.00318.89
8.3.30.0080.00818.96
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.260.0060.01316.46
8.2.250.0000.00816.54
8.2.240.0040.00417.20
8.2.230.0040.00422.58
8.2.220.0090.00037.54
8.2.210.0120.00326.77
8.2.200.0060.00616.50
8.2.190.0160.00316.75
8.2.180.0070.00725.92
8.2.170.0080.01219.02
8.2.160.0090.00622.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00026.35
8.2.110.0000.00922.20
8.2.100.0090.00317.84
8.2.90.0090.00018.03
8.2.80.0040.00418.05
8.2.70.0100.00017.80
8.2.60.0050.00518.34
8.2.50.0030.00518.10
8.2.40.0030.00519.37
8.2.30.0000.00819.18
8.2.20.0000.00718.05
8.2.10.0040.00419.31
8.2.00.0030.00319.23
8.1.310.0060.01316.73
8.1.300.0050.00318.62
8.1.290.0030.00630.84
8.1.280.0030.01725.92
8.1.270.0050.00323.99
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0110.00017.48
8.1.230.0080.00422.75
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0030.00618.55
8.1.160.0050.00219.06
8.1.150.0050.00218.81
8.1.140.0040.00418.76
8.1.130.0040.00420.14
8.1.120.0040.00417.40
8.1.110.0030.00517.44
8.1.100.0000.00817.46
8.1.90.0070.00017.48
8.1.80.0020.00517.43
8.1.70.0050.00317.34
8.1.60.0040.00417.61
8.1.50.0040.00417.46
8.1.40.0070.00417.57
8.1.30.0000.00817.55
8.1.20.0000.00817.64
8.1.10.0040.00417.54
8.1.00.0050.00317.56
8.0.300.0040.00420.19
8.0.290.0030.00616.63
8.0.280.0070.00018.44
8.0.270.0030.00316.93
8.0.260.0000.00618.44
8.0.250.0000.00617.04
8.0.240.0040.00416.99
8.0.230.0040.00417.00
8.0.220.0070.00016.84
8.0.210.0040.00416.85
8.0.200.0000.00816.99
8.0.190.0030.00416.98
8.0.180.0040.00416.98
8.0.170.0090.00016.78
8.0.160.0030.00516.87
8.0.150.0000.00716.83
8.0.140.0050.00216.87
8.0.130.0030.00313.36
8.0.120.0030.00616.73
8.0.110.0040.00416.92
8.0.100.0000.00716.93
8.0.90.0040.00416.69
8.0.80.0070.01216.88
8.0.70.0060.00316.75
8.0.60.0040.00416.84
8.0.50.0000.00716.73
8.0.30.0140.00717.09
8.0.20.0150.00517.07
8.0.10.0000.00817.07
8.0.00.0090.01616.77
7.4.330.0000.00415.55
7.4.320.0060.00016.43
7.4.300.0000.00616.48
7.4.290.0080.00016.51
7.4.280.0050.00316.50
7.4.270.0030.00316.49
7.4.260.0000.00513.30
7.4.250.0000.00716.35
7.4.240.0000.00816.61
7.4.230.0000.00716.63
7.4.220.0020.00516.58
7.4.210.0080.00916.63
7.4.200.0000.00716.50
7.4.130.0070.01116.65
7.4.120.0120.01216.63
7.4.110.0150.00616.69
7.4.100.0090.01216.58
7.4.90.0090.01216.35
7.4.80.0140.00816.45
7.4.70.0040.01416.74
7.4.60.0090.00816.49
7.4.50.0070.01116.57
7.4.40.0100.00716.49
7.4.30.0160.00016.49
7.4.20.0040.01216.37
7.4.10.0120.00316.44
7.4.00.0090.00616.63
7.3.330.0030.00316.37
7.3.320.0050.00013.31
7.3.310.0070.00016.30
7.3.300.0030.00316.40
7.3.290.0100.00816.39
7.3.260.0120.00416.59
7.3.230.0160.00016.38
7.3.210.0130.00416.34
7.3.200.0160.00616.24
7.3.190.0090.01316.44
7.3.180.0070.01016.44
7.3.170.0060.01116.34
7.3.160.0060.00916.63
7.3.150.0070.01016.55
7.3.140.0160.00016.39
7.3.130.0030.01316.47
7.3.120.0060.00916.56
7.3.110.0090.00616.39
7.3.100.0170.00016.44
7.3.90.0030.01216.36
7.3.80.0080.00816.22
7.3.70.0100.00616.04
7.3.60.0080.00816.27
7.3.50.0000.01716.35
7.3.40.0070.01616.16
7.3.30.0070.01116.49
7.3.20.0120.00616.36
7.3.10.0090.00816.45
7.3.00.0110.00516.53
7.2.330.0060.01316.54
7.2.320.0130.00716.42
7.2.310.0090.00916.75
7.2.300.0100.00716.51
7.2.290.0160.00316.54
7.2.280.0100.00716.64
7.2.270.0130.00316.61
7.2.260.0130.00316.86
7.2.250.0120.00416.45
7.2.240.0110.00716.78
7.2.230.0070.01016.84
7.2.220.0070.01116.52
7.2.210.0060.01216.38
7.2.200.0120.00616.30
7.2.190.0030.01416.66
7.2.180.0110.01216.50
7.2.170.0080.00816.60
7.2.160.0050.01316.60
7.2.150.0120.00616.61
7.2.140.0120.00616.55
7.2.130.0150.00316.62
7.2.120.0180.00016.76
7.2.110.0130.01016.57
7.2.100.0160.00616.52
7.2.90.0220.00916.77
7.2.80.0030.01416.48
7.2.70.0120.00616.70
7.2.60.0090.00916.53
7.2.50.0140.00316.69
7.2.40.0110.00616.70
7.2.30.0030.01416.75
7.2.20.0150.00316.70
7.2.10.0090.00916.65
7.2.00.0000.01716.65

preferences:
29.13 ms | 403 KiB | 5 Q