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 } print_r($unique); 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.0070.00716.50
8.3.50.0110.00718.09
8.3.40.0090.00618.84
8.3.30.0120.00318.86
8.3.20.0040.00420.13
8.3.10.0080.00021.04
8.3.00.0000.00820.94
8.2.180.0180.00416.75
8.2.170.0070.01022.96
8.2.160.0100.00719.46
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00817.92
8.2.120.0050.00326.35
8.2.110.0090.00022.16
8.2.100.0070.00417.91
8.2.90.0050.00319.21
8.2.80.0000.00817.97
8.2.70.0100.00017.75
8.2.60.0040.00418.05
8.2.50.0040.00418.10
8.2.40.0030.00522.31
8.2.30.0090.00019.29
8.2.20.0000.00818.11
8.2.10.0000.00718.19
8.2.00.0000.00718.19
8.1.280.0000.01425.92
8.1.270.0080.00022.13
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00923.88
8.1.230.0080.00322.13
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0080.00018.63
8.1.160.0040.00419.12
8.1.150.0000.00718.77
8.1.140.0050.00219.54
8.1.130.0000.01018.77
8.1.120.0030.00417.40
8.1.110.0040.00417.35
8.1.100.0000.00817.50
8.1.90.0000.00717.36
8.1.80.0040.00417.48
8.1.70.0030.00317.39
8.1.60.0040.00417.51
8.1.50.0080.00017.58
8.1.40.0000.00717.47
8.1.30.0000.00817.63
8.1.20.0050.00217.61
8.1.10.0080.00017.45
8.1.00.0000.00717.48
8.0.300.0080.00018.77
8.0.290.0050.00516.63
8.0.280.0050.00318.51
8.0.270.0070.00017.22
8.0.260.0030.00320.80
8.0.250.0070.00016.96
8.0.240.0000.00716.89
8.0.230.0070.00316.97
8.0.220.0000.00716.80
8.0.210.0050.00516.86
8.0.200.0000.00716.85
8.0.190.0000.00816.85
8.0.180.0040.00416.90
8.0.170.0000.00716.88
8.0.160.0070.00016.94
8.0.150.0030.00316.83
8.0.140.0030.00416.86
8.0.130.0000.00513.29
8.0.120.0040.00416.86
8.0.110.0060.00316.93
8.0.100.0000.00816.84
8.0.90.0000.00716.77
8.0.80.0070.01116.93
8.0.70.0070.00017.01
8.0.60.0030.00516.75
8.0.50.0000.00816.98
8.0.30.0140.00517.08
8.0.20.0150.00517.40
8.0.10.0040.00417.00
8.0.00.0050.01316.91
7.4.330.0000.00615.55
7.4.320.0000.00616.61
7.4.300.0030.00316.57
7.4.290.0030.00316.45
7.4.280.0040.00416.51
7.4.270.0040.00416.65
7.4.260.0000.00716.54
7.4.250.0040.00416.55
7.4.240.0080.00016.66
7.4.230.0050.00316.41
7.4.220.0150.00916.52
7.4.210.0050.01116.61
7.4.200.0040.00416.56
7.4.160.0120.00616.54
7.4.150.0100.01017.40
7.4.140.0130.00717.86
7.4.130.0090.00916.41
7.4.120.0100.00916.44
7.4.110.0100.00716.53
7.4.100.0060.01016.42
7.4.90.0100.00716.45
7.4.80.0030.01319.39
7.4.70.0080.00916.28
7.4.60.0160.00016.43
7.4.50.0040.00816.60
7.4.40.0110.00616.30
7.4.30.0120.00316.72
7.4.00.0100.00315.06
7.3.330.0050.00013.06
7.3.320.0040.00413.08
7.3.310.0030.00316.42
7.3.300.0030.00316.30
7.3.290.0000.00716.31
7.3.280.0100.00816.32
7.3.270.0130.00417.40
7.3.260.0100.00916.34
7.3.250.0090.00916.37
7.3.240.0130.00516.31
7.3.230.0110.00516.43
7.3.210.0070.01316.45
7.3.200.0030.01316.28
7.3.190.0050.01016.44
7.3.180.0030.01216.44
7.3.170.0100.00716.52
7.3.160.0120.00316.38
7.3.10.0070.01016.67
7.3.00.0070.00616.64
7.2.330.0120.00616.46
7.2.320.0120.00616.48
7.2.310.0030.01416.54
7.2.300.0100.01316.70
7.2.290.0080.00816.56
7.2.130.0000.01116.89
7.2.120.0020.01116.65
7.2.110.0030.00916.94
7.2.100.0080.00516.83
7.2.90.0070.00416.78
7.2.80.0080.00716.87
7.2.70.0050.00716.68
7.2.60.0070.00616.82
7.2.50.0070.00516.87
7.2.40.0090.00216.72
7.2.30.0030.00816.83
7.2.20.0060.00816.60
7.2.10.0110.00516.80
7.2.00.0090.00616.90
7.1.250.0040.00615.64
7.1.240.0030.00715.71
7.1.230.0070.00315.77
7.1.220.0100.00315.78
7.1.210.0030.00615.75
7.1.200.0070.00515.63
7.1.190.0040.00715.51
7.1.180.0060.00315.85
7.1.170.0070.00315.77
7.1.160.0060.00615.93
7.1.150.0030.01015.46
7.1.140.0030.00915.64
7.1.130.0080.00415.82
7.1.120.0030.00915.69
7.1.110.0000.01315.96
7.1.100.0110.00016.08
7.1.90.0040.01115.62
7.1.80.0030.00615.63
7.1.70.0070.01115.56
7.1.60.2900.00824.37
7.1.50.2160.01524.28
7.1.40.2210.00824.40
7.1.30.1970.01024.43
7.1.20.2030.01224.27
7.1.10.2000.00915.22
7.1.00.1700.01215.43
7.0.330.0000.01115.14
7.0.320.0080.00415.39
7.0.310.0090.00315.14
7.0.300.0040.00815.36
7.0.290.0030.00914.98
7.0.280.0030.01115.19
7.0.270.0120.00014.98
7.0.260.0030.00815.23
7.0.250.0040.00815.38
7.0.240.0030.00615.42
7.0.230.0060.00315.38
7.0.220.0040.00415.34
7.0.210.0030.00815.37
7.0.200.2210.00815.29
7.0.190.1860.00814.96
7.0.180.1620.00514.97
7.0.170.2130.01314.87
7.0.160.2370.00914.83
7.0.150.1690.01114.91
7.0.140.1570.01014.93
7.0.130.0110.00915.01
7.0.120.0100.00815.05
7.0.110.1870.01314.98
7.0.100.0110.00715.00
7.0.90.0090.01014.83
7.0.80.0070.00814.86
7.0.70.0080.00915.02
7.0.60.0080.00714.82
7.0.50.0100.00814.96
7.0.40.0210.00513.97
7.0.30.0080.01014.15
7.0.20.0130.00813.94
7.0.10.0630.00714.06
7.0.00.0050.00913.90
5.6.380.0090.00614.59

preferences:
62.89 ms | 400 KiB | 5 Q