3v4l.org

run code in 300+ PHP versions simultaneously
<?php $messages = array( 'message1'=>array( 'type'=>'voice', 'call-id'=>'11', 'id'=>'message1' ), 'message2'=>array( 'type'=>'voice', 'call-id'=>'44', 'id'=>'message2' ), 'message3'=>array( 'type'=>'text', 'call-id'=>'44', 'id'=>'message3' ), 'message4'=>array( 'type'=>'text', 'call-id'=>'55', 'id'=>'message4' ), 'message5'=>array( 'type'=>'voice', 'call-id'=>'55', 'id'=>'message5' ), ); foreach ($messages as $message => $value) { $unique[$value['call-id']] = $value; // this will override the previous value with the same key if exists } foreach ($unique as $key => $value) { $array[$value['id']] = $value; } echo '<pre>'; print_r($array);

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.0110.00316.75
8.3.50.0040.01418.29
8.3.40.0070.01318.70
8.3.30.0040.01118.93
8.3.20.0040.00420.13
8.3.10.0090.00020.94
8.3.00.0000.00820.77
8.2.180.0090.00616.63
8.2.170.0100.01022.96
8.2.160.0030.01719.32
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00018.03
8.2.120.0000.00826.35
8.2.110.0030.00722.14
8.2.100.0090.00317.91
8.2.90.0030.00619.25
8.2.80.0040.00417.97
8.2.70.0080.00017.75
8.2.60.0000.00717.93
8.2.50.0040.00418.10
8.2.40.0050.00322.26
8.2.30.0050.00219.19
8.2.20.0000.00718.04
8.2.10.0080.00018.23
8.2.00.0000.00718.04
8.1.280.0110.00725.92
8.1.270.0080.00022.06
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.20
8.1.230.0070.00419.00
8.1.220.0060.00317.79
8.1.210.0080.00018.77
8.1.200.0030.00617.25
8.1.190.0030.00617.22
8.1.180.0060.00318.10
8.1.170.0030.00618.71
8.1.160.0040.00419.01
8.1.150.0040.00418.83
8.1.140.0000.00719.45
8.1.130.0000.00918.80
8.1.120.0030.00317.45
8.1.110.0040.00417.45
8.1.100.0030.00517.36
8.1.90.0030.00317.39
8.1.80.0030.00317.46
8.1.70.0000.00717.41
8.1.60.0030.00617.63
8.1.50.0080.00017.52
8.1.40.0030.00617.52
8.1.30.0040.00417.55
8.1.20.0040.00417.67
8.1.10.0040.00417.45
8.1.00.0000.00717.52
8.0.300.0040.00418.77
8.0.290.0060.00316.58
8.0.280.0000.00718.45
8.0.270.0030.00517.26
8.0.260.0000.00618.97
8.0.250.0000.00716.95
8.0.240.0000.00716.89
8.0.230.0060.00316.95
8.0.220.0030.00316.88
8.0.210.0030.00616.88
8.0.200.0000.00716.94
8.0.190.0000.00816.84
8.0.180.0000.00816.87
8.0.170.0040.00416.96
8.0.160.0000.00716.87
8.0.150.0040.00416.83
8.0.140.0050.00216.84
8.0.130.0030.00313.30
8.0.120.0040.00416.80
8.0.110.0000.00816.77
8.0.100.0000.00716.77
8.0.90.0070.00016.91
8.0.80.0110.01116.92
8.0.70.0030.00516.74
8.0.60.0020.00516.68
8.0.50.0050.00216.75
8.0.30.0090.00817.19
8.0.20.0090.01017.40
8.0.10.0080.00017.05
8.0.00.0000.01816.82
7.4.330.0050.00015.55
7.4.320.0000.00616.37
7.4.300.0030.00316.61
7.4.290.0030.00316.43
7.4.280.0000.00716.41
7.4.270.0070.00016.55
7.4.260.0000.00716.60
7.4.250.0050.00316.46
7.4.240.0030.00316.41
7.4.230.0000.00716.49
7.4.220.0000.00716.48
7.4.210.0080.00716.54
7.4.200.0050.00216.30
7.4.160.0110.00516.33
7.4.150.0090.00917.40
7.4.140.0090.01117.86
7.4.130.0110.00516.48
7.4.120.0080.01116.57
7.4.110.0060.01016.43
7.4.100.0090.01216.50
7.4.90.0070.01016.56
7.4.80.0100.00719.39
7.4.70.0150.00616.46
7.4.60.0030.01316.29
7.4.50.0060.00616.40
7.4.40.0090.00916.34
7.4.30.0100.00716.56
7.4.00.0070.00714.92
7.3.330.0000.00513.25
7.3.320.0030.00313.25
7.3.310.0030.00316.42
7.3.300.0000.00816.23
7.3.290.0030.00316.34
7.3.280.0080.01016.35
7.3.270.0040.01317.40
7.3.260.0130.00516.47
7.3.250.0070.01116.50
7.3.240.0070.01016.38
7.3.230.0120.00616.53
7.3.210.0100.00716.38
7.3.200.0070.01116.32
7.3.190.0100.00616.48
7.3.180.0060.00916.42
7.3.170.0060.00916.28
7.3.160.0120.00316.32
7.2.330.0130.00316.65
7.2.320.0060.01216.70
7.2.310.0060.01116.72
7.2.300.0120.00416.78
7.2.290.0070.01016.51
7.2.60.0000.01716.95
7.2.50.0170.00616.78
7.1.200.0080.00015.85
7.1.70.1150.00315.44
7.1.60.1200.01033.35
7.1.50.1120.01333.12
7.1.40.2280.00632.68
7.1.30.2560.02632.59
7.1.20.1120.01032.53
7.1.10.0970.01014.69
7.1.00.0920.00714.82
7.0.200.1390.00714.92
7.0.190.2310.01014.90
7.0.180.1950.01014.38
7.0.170.1730.00714.54
7.0.160.1140.01014.44
7.0.150.0950.01014.53
7.0.140.1040.00714.33
7.0.130.0910.00714.87
7.0.120.0860.01014.75
7.0.110.0960.01314.65
7.0.100.0910.01014.58
7.0.90.1010.01014.51
7.0.80.0970.01014.45
7.0.70.1010.01014.54
7.0.60.1250.00014.40
7.0.50.0030.01014.50
7.0.40.1130.00714.76
7.0.30.1320.01014.90
7.0.20.1230.01014.66
7.0.10.1340.01014.55
7.0.00.1190.01314.78

preferences:
57.88 ms | 401 KiB | 5 Q