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 } $unique = usort($unique, "cmp"); print_r($unique); foreach ($unique as $key => $value) { $array[$value['id']] = $value; } echo '<pre>'; print_r($array); function cmp($a, $b) { return $a["call-id"] - $b["call-id"]; }

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.70.0090.00616.88
8.3.60.0040.01116.62
8.3.50.0020.01417.31
8.3.40.0140.00018.76
8.3.30.0140.00018.70
8.3.20.0020.00520.20
8.3.10.0050.00321.03
8.3.00.0000.00820.77
8.2.180.0110.00716.50
8.2.170.0180.00322.96
8.2.160.0100.00319.46
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00018.16
8.2.120.0040.00426.35
8.2.110.0060.00920.87
8.2.100.0090.00318.03
8.2.90.0040.00419.17
8.2.80.0000.00818.03
8.2.70.0020.00717.75
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0000.00822.31
8.2.30.0000.00719.27
8.2.20.0000.00718.18
8.2.10.0000.00818.05
8.2.00.0050.00218.07
8.1.280.0150.00325.92
8.1.270.0000.00922.11
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00019.26
8.1.230.0110.00019.21
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0080.00017.00
8.1.180.0040.00418.10
8.1.170.0040.00418.34
8.1.160.0000.00719.02
8.1.150.0020.00518.84
8.1.140.0040.00419.68
8.1.130.0090.00018.76
8.1.120.0000.00717.50
8.1.110.0030.00517.43
8.1.100.0000.00717.44
8.1.90.0040.00417.46
8.1.80.0000.00717.46
8.1.70.0000.00717.37
8.1.60.0000.00817.48
8.1.50.0040.00417.43
8.1.40.0060.00317.50
8.1.30.0040.00417.69
8.1.20.0060.00317.49
8.1.10.0040.00417.52
8.1.00.0030.00617.48
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0030.00318.35
8.0.270.0000.00717.25
8.0.260.0000.00820.67
8.0.250.0030.00316.96
8.0.240.0040.00417.04
8.0.230.0030.00616.91
8.0.220.0040.00416.96
8.0.210.0020.00716.97
8.0.200.0000.00816.87
8.0.190.0040.00417.00
8.0.180.0070.00017.01
8.0.170.0040.00417.04
8.0.160.0050.00316.97
8.0.150.0070.00016.94
8.0.140.0040.00416.80
8.0.130.0000.00513.37
8.0.120.0000.00716.91
8.0.110.0030.00516.74
8.0.100.0040.00416.82
8.0.90.0040.00416.76
8.0.80.0150.00816.97
8.0.70.0030.00616.79
8.0.60.0030.00516.98
8.0.50.0040.00417.06
8.0.30.0070.00917.04
8.0.20.0080.01017.40
8.0.10.0040.00417.09
8.0.00.0110.01116.72
7.4.330.0050.00015.55
7.4.320.0030.00316.53
7.4.300.0030.00316.60
7.4.290.0000.00716.50
7.4.280.0040.00416.59
7.4.270.0050.00316.46
7.4.260.0030.00316.48
7.4.250.0000.00716.46
7.4.240.0070.00016.66
7.4.230.0040.00416.63
7.4.220.0130.01316.54
7.4.210.0060.01016.60
7.4.200.0070.00016.53
7.4.160.0150.00516.45
7.4.150.0090.00917.40
7.4.140.0120.01017.86
7.4.130.0120.00616.86
7.4.120.0110.01216.54
7.4.110.0060.01116.63
7.4.100.0110.00616.52
7.4.90.0060.01216.41
7.4.80.0090.00919.39
7.4.70.0100.01016.73
7.4.60.0100.00616.55
7.4.50.0090.00316.64
7.4.40.0070.01516.73
7.4.30.0080.00816.40
7.4.10.0070.01115.12
7.4.00.0070.01014.94
7.3.330.0000.00513.38
7.3.320.0030.00313.27
7.3.310.0040.00416.32
7.3.300.0050.00216.43
7.3.290.0000.00716.38
7.3.280.0070.01016.39
7.3.270.0080.00817.40
7.3.260.0030.01316.44
7.3.250.0110.00716.39
7.3.240.0060.01016.47
7.3.230.0090.01016.39
7.3.210.0060.00916.39
7.3.200.0090.01216.52
7.3.190.0040.01116.57
7.3.180.0080.00816.57
7.3.170.0060.00916.47
7.3.160.0120.00316.43
7.3.130.0150.00315.15
7.3.120.0140.00415.05
7.3.110.0030.01314.78
7.3.100.0090.00614.85
7.3.90.0080.00815.10
7.3.80.0090.00614.60
7.3.70.0030.00614.95
7.3.60.0030.00914.93
7.3.50.0030.00614.85
7.3.40.0030.01114.84
7.3.30.0060.00614.94
7.3.20.0080.00316.57
7.3.10.0070.00516.69
7.3.00.0070.00616.68
7.2.330.0060.01216.77
7.2.320.0030.01616.71
7.2.310.0100.00716.74
7.2.300.0060.01616.68
7.2.290.0040.01416.43
7.2.260.0100.00714.99
7.2.250.0060.01015.23
7.2.240.0150.00015.35
7.2.230.0100.00315.18
7.2.220.0030.01215.07
7.2.210.0090.00315.27
7.2.200.0000.01314.97
7.2.190.0060.00814.78
7.2.180.0070.01014.95
7.2.170.0030.00614.99
7.2.160.0050.00515.07
7.2.150.0030.01316.94
7.2.140.0030.01316.81
7.2.130.0100.00516.92
7.2.120.0080.00817.02
7.2.110.0030.01216.91
7.2.100.0070.00516.90
7.2.90.0040.01016.90
7.2.80.0020.01216.82
7.2.70.0080.00716.96
7.2.60.0060.00916.88
7.2.50.0060.01016.91
7.2.40.0070.00616.96
7.2.30.0050.00616.79
7.2.20.0080.00616.88
7.2.10.0080.00917.08
7.2.00.0070.00717.03
7.1.330.0130.00315.75
7.1.320.0070.01115.63
7.1.310.0030.00915.71
7.1.300.0030.00915.55
7.1.290.0060.00915.81
7.1.280.0000.01415.84
7.1.270.0060.00315.66
7.1.260.0100.00715.86
7.1.250.0070.00515.81
7.1.240.0000.01515.80
7.1.230.0030.01015.86
7.1.220.0100.00315.75
7.1.210.0040.00715.92
7.1.200.0030.00515.69
7.1.190.0090.00615.82
7.1.180.0030.01015.94
7.1.170.0080.00415.83
7.1.160.0070.00715.80
7.1.150.0000.01415.84
7.1.140.0040.01515.62
7.1.130.0060.00915.89
7.1.120.0100.01015.72
7.1.110.0060.01015.47
7.1.100.0150.00416.02
7.1.90.0080.00415.86
7.1.80.0060.00315.87
7.1.70.0050.01016.43
7.1.60.0130.01525.55
7.1.50.0080.01425.45
7.1.40.0150.01225.30
7.1.30.0150.01125.10
7.1.20.0190.00825.24
7.1.10.0010.01716.14
7.1.00.0070.00916.36
7.0.330.0060.00315.29
7.0.320.0070.00715.43
7.0.310.0000.00815.53
7.0.300.0060.00315.43
7.0.290.0090.00315.63
7.0.280.0040.01115.25
7.0.270.0030.01315.35
7.0.260.0110.00015.51
7.0.250.0040.01415.54
7.0.240.0120.00615.44
7.0.230.0100.00315.61
7.0.220.0040.00415.37
7.0.210.0060.00915.47
7.0.200.0120.00516.06
7.0.190.0090.00916.07
7.0.180.0080.00915.58
7.0.170.0060.01015.86
7.0.160.0090.00715.75
7.0.150.0070.00915.79
7.0.140.0080.00615.90
7.0.130.0030.01115.81
7.0.120.0090.00615.99
7.0.110.0050.01315.92
7.0.100.0040.01315.94
7.0.90.0120.00615.89
7.0.80.0070.00815.81
7.0.70.0030.01215.89
7.0.60.0090.00815.71
7.0.50.0100.00915.85
7.0.40.0100.00714.97
7.0.30.0020.01215.20
7.0.20.0070.01014.72
7.0.10.0100.00614.92
7.0.00.0050.01114.86
5.6.400.0130.00014.45
5.6.390.0030.01014.67
5.6.380.0060.00614.32
5.6.370.0030.00714.49
5.6.360.0000.00914.30
5.6.350.0000.01414.21
5.6.340.0030.01014.37
5.6.330.0090.00614.66
5.6.320.0120.00314.37
5.6.310.0100.00314.65
5.6.300.0030.01014.51
5.6.290.0000.00914.64
5.6.280.0060.00914.14
5.6.270.0030.01114.82
5.6.260.0100.00014.59
5.6.250.0000.01114.47
5.6.240.0110.00414.45
5.6.230.0040.00814.70
5.6.220.0110.00714.53
5.6.210.0030.01014.72
5.6.200.0090.00414.39
5.6.190.0040.00714.52
5.6.180.0030.01214.31
5.6.170.0040.01114.53
5.6.160.0070.00714.25
5.6.150.0000.00914.30
5.6.140.0060.00714.47
5.6.130.0000.00914.56
5.6.120.0060.00614.69
5.6.110.0030.00614.23
5.6.100.0000.00914.29
5.6.90.0030.00614.23
5.6.80.0000.01014.14
5.6.70.0060.00614.52
5.6.60.0150.00014.34
5.6.50.0070.00714.17
5.6.40.0000.01314.42
5.6.30.0090.00314.64
5.6.20.0040.00414.66
5.6.10.0040.00714.17
5.6.00.0040.00814.65

preferences:
62.13 ms | 401 KiB | 5 Q