3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array( "0" => Array ( "id" => "pZgauDZtvQ9grRD9c", "rid" => "obHEGwnrfHKCd32jF", "starttime" => "14-02-2018", "chatduration" => 124.502, "username" => "bhavin", "status" => "open" ), "1" => Array ( "id" => "ej5WfYe3dn8mtHzQF", "rid" => "o6pKCt4e6RaYiZhQ8", "starttime" => "14-02-2018", "chatduration" => 1072.628, "username" => "bhavin", "status" => "closed" ), "2" => Array ( "id" => "qCzZjf7vb4rSBRndk", "rid" => "ZFvuuFiL9RFiemX3K", "starttime" => "14-02-2018", "chatduration" => 11.254, "username" => "lokesh", "status" => "closed" ), "3" => Array ( "id" => "TCdSycFFSeY8WaKzG", "rid" => "f7ADPWFsCD6RZFspk", "starttime" => "14-02-2018", "chatduration" => 121.228, "username" => "lokesh", "status" => "closed" ) ); // create new associative array foreach($arr as $subarr){ $new[$subarr["username"]][] = $subarr; } // loop each username and create result array foreach($new as $user => $subarr){ $result[$user]["duration"] = array_sum(array_column($subarr, "chatduration")); // @ to supress notice if no open/closed is in array @$result[$user]["open"] = array_count_values(array_column($subarr, "status"))["open"]; @$result[$user]["closed"] = array_count_values(array_column($subarr, "status"))["closed"]; } $result["total"]["duration"] = array_sum(array_column($result, "duration")); $result["total"]["open"] = array_sum(array_column($result, "open")); $result["total"]["closed"] = array_sum(array_column($result, "closed")); var_dump($result);

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.10.0120.00716.90
8.5.00.0130.00920.17
8.4.150.0030.00014.05
8.4.140.0140.01217.84
8.4.130.0090.01218.62
8.4.120.0100.00724.16
8.4.110.0090.00318.67
8.4.100.0090.01018.58
8.4.90.0100.01020.51
8.4.80.0050.00319.04
8.4.70.0130.01018.30
8.4.60.0130.00718.84
8.4.50.0130.00720.67
8.4.40.0070.01419.65
8.4.30.0100.01017.75
8.4.20.0110.01119.53
8.4.10.0060.00317.91
8.3.280.0140.01418.76
8.3.270.0150.00816.68
8.3.260.0140.00416.64
8.3.250.0100.00818.80
8.3.240.0100.00917.13
8.3.230.0120.00816.58
8.3.220.0070.01019.00
8.3.210.0110.00716.66
8.3.200.0040.00516.63
8.3.190.0050.00317.37
8.3.180.0100.00816.82
8.3.170.0040.00419.22
8.3.160.0100.00016.68
8.3.150.0100.01020.89
8.3.140.0120.00616.73
8.3.130.0030.00618.52
8.3.120.0040.00419.16
8.3.110.0030.00516.90
8.3.100.0070.01120.43
8.3.90.0050.00326.77
8.3.80.0060.00617.00
8.3.70.0130.00318.68
8.3.60.0140.00018.68
8.3.50.0120.00616.58
8.3.40.0090.00618.79
8.3.30.0060.00918.57
8.3.20.0070.00021.88
8.3.10.0080.00021.85
8.3.00.0080.00019.79
8.2.290.0140.00920.30
8.2.280.0060.00218.53
8.2.270.0150.00417.19
8.2.260.0120.00616.46
8.2.250.0080.00016.70
8.2.240.0120.00616.73
8.2.230.0030.00720.94
8.2.220.0060.00324.06
8.2.210.0040.01126.77
8.2.200.0100.00016.63
8.2.190.0070.00716.63
8.2.180.0090.00916.77
8.2.170.0040.01422.96
8.2.160.0100.00320.57
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.83
8.2.110.0080.00421.04
8.2.100.0060.00617.66
8.2.90.0040.00417.97
8.2.80.0040.00418.28
8.2.70.0060.00317.63
8.2.60.0080.00017.50
8.2.50.0060.00317.91
8.2.40.0000.00819.47
8.2.30.0070.00020.98
8.2.20.0040.00418.08
8.2.10.0060.00318.14
8.2.00.0070.00018.14
8.1.330.0070.01222.07
8.1.320.0130.00618.30
8.1.310.0060.00916.73
8.1.300.0060.00318.16
8.1.290.0080.00330.84
8.1.280.0090.01225.92
8.1.270.0040.00422.19
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0000.00924.00
8.1.230.0000.01120.89
8.1.220.0070.00017.79
8.1.210.0050.00318.78
8.1.200.0000.00817.35
8.1.190.0080.00317.13
8.1.180.0040.00418.10
8.1.170.0040.00417.62
8.1.160.0000.00718.96
8.1.150.0080.00021.96
8.1.140.0000.00717.70
8.1.130.0060.00319.02
8.1.120.0030.00417.41
8.1.110.0040.00417.36
8.1.100.0040.00417.38
8.1.90.0000.00817.39
8.1.80.0000.00917.47
8.1.70.0000.00717.43
8.1.60.0030.00517.63
8.1.50.0030.00917.52
8.1.40.0070.00017.55
8.1.30.0050.00317.63
8.1.20.0050.00217.60
8.1.10.0040.00417.52
8.1.00.0050.00317.41
8.0.300.0040.00419.90
8.0.290.0040.00416.75
8.0.280.0030.00318.41
8.0.270.0030.00317.15
8.0.260.0070.00016.86
8.0.250.0030.00317.05
8.0.240.0000.00816.89
8.0.230.0000.00716.99
8.0.220.0000.00716.81
8.0.210.0000.00816.86
8.0.200.0000.00817.07
8.0.190.0000.00816.92
8.0.180.0060.00317.02
8.0.170.0040.00416.88
8.0.160.0040.00416.99
8.0.150.0060.00516.92
8.0.140.0040.00416.94
8.0.130.0030.00313.43
8.0.120.0040.00416.82
8.0.110.0080.00016.86
8.0.100.0000.00716.79
8.0.90.0040.00416.80
8.0.80.0000.01616.97
8.0.70.0040.00416.82
8.0.60.0040.00417.04
8.0.50.0050.00316.89
8.0.30.0100.00817.11
8.0.20.0130.00917.40
8.0.10.0050.00317.07
8.0.00.0110.00616.83
7.4.330.0060.00015.55
7.4.320.0000.00716.44
7.4.300.0000.00616.50
7.4.290.0060.00316.53
7.4.280.0040.00416.59
7.4.270.0070.00016.57
7.4.260.0000.00716.64
7.4.250.0040.00416.55
7.4.240.0000.00716.51
7.4.230.0000.00716.56
7.4.220.0000.00916.69
7.4.210.0090.01216.57
7.4.200.0040.00416.64
7.4.160.0130.00716.63
7.4.150.0220.00317.40
7.4.140.0110.01017.86
7.4.130.0100.00716.72
7.4.120.0080.01216.52
7.4.110.0080.00916.80
7.4.100.0110.01216.43
7.4.90.0140.00716.36
7.4.80.0030.02119.39
7.4.70.0110.00716.65
7.4.60.0140.00416.39
7.4.50.0130.00316.69
7.4.40.0100.00616.47
7.4.10.0040.01514.77
7.4.00.0110.00714.97
7.3.330.0000.00613.14
7.3.320.0000.00513.29
7.3.310.0070.00016.34
7.3.300.0030.00316.43
7.3.290.0070.00016.41
7.3.280.0120.00916.42
7.3.270.0060.01217.40
7.3.260.0120.00816.59
7.3.240.0110.00816.48
7.3.230.0040.01416.68
7.3.210.0110.01116.52
7.3.200.0070.01016.47
7.3.190.0100.00716.48
7.3.180.0120.00316.51
7.3.170.0090.00916.54
7.3.160.0120.00416.52
7.3.130.0070.01115.03
7.3.120.0080.01014.91
7.3.110.0030.01715.11
7.3.100.0040.01115.10
7.3.90.0070.01014.84
7.3.80.0000.00915.18
7.3.70.0030.01014.98
7.3.60.0040.00814.93
7.3.50.0090.00614.66
7.3.40.0000.01614.72
7.3.30.0120.00314.68
7.3.20.0150.00316.68
7.3.10.0040.00716.48
7.3.00.0000.01116.46
7.2.330.0130.00516.66
7.2.320.0080.00816.73
7.2.310.0070.01616.70
7.2.300.0110.00616.71
7.2.290.0100.00516.81
7.2.260.0070.01415.06
7.2.250.0110.00715.22
7.2.240.0100.00614.69
7.2.230.0030.01314.95
7.2.220.0000.01415.09
7.2.210.0070.00315.35
7.2.200.0000.01615.17
7.2.190.0070.00714.95
7.2.180.0030.00615.28
7.2.170.0070.01015.12
7.2.160.0100.01014.83
7.2.150.0030.01216.98
7.2.140.0110.00417.05
7.2.130.0060.01116.90
7.2.120.0110.00716.75
7.2.110.0150.00316.65
7.2.100.0000.01416.84
7.2.90.0000.01116.93
7.2.80.0100.00717.22
7.2.70.0060.00917.16
7.2.60.0050.01016.84
7.2.50.0110.00416.80
7.2.40.0130.00317.03
7.2.30.0060.00917.04
7.2.20.0080.01418.42
7.2.10.0080.01418.38
7.2.00.0120.00817.34
7.1.330.0030.01015.82
7.1.320.0070.01015.72
7.1.310.0040.01115.59
7.1.300.0090.00015.83
7.1.290.0030.01015.51
7.1.280.0030.01415.87
7.1.270.0090.00615.91
7.1.260.0030.00615.76
7.1.250.0040.00715.80
7.1.240.0030.01315.99
7.1.230.0000.01515.71
7.1.220.0030.00915.91
7.1.210.0090.00615.63
7.1.200.0100.00815.67
7.1.190.0090.00615.95
7.1.180.0000.01415.94
7.1.170.0030.01015.54
7.1.160.0090.00316.02
7.1.150.0040.00915.68
7.1.140.0080.00817.15
7.1.130.0090.00817.21
7.1.120.0060.00917.32
7.1.110.0120.00816.99
7.1.100.0130.00915.83
7.1.90.0060.01116.87
7.1.80.0140.00816.85
7.1.70.0120.01015.65
7.1.60.0170.01125.44
7.1.50.0190.01425.24
7.1.40.0130.01625.26
7.1.30.0200.01324.30
7.1.20.0220.01025.12
7.1.10.0110.00716.26
7.1.00.0090.00916.36
7.0.330.0070.00715.24
7.0.320.0040.01115.44
7.0.310.0040.00415.60
7.0.300.0060.00615.54
7.0.290.0000.01415.28
7.0.280.0030.00715.26
7.0.270.0070.01015.34
7.0.260.0000.00915.33
7.0.250.0120.00015.61
7.0.240.0070.00715.57
7.0.230.0080.00615.36
7.0.220.0040.00815.47
7.0.210.0090.00015.11
7.0.200.0080.00415.41
7.0.190.0070.00715.36
7.0.180.0060.00615.15
7.0.170.0040.00715.52
7.0.160.0030.00715.48
7.0.150.0080.00315.44
7.0.140.0000.01515.46
7.0.130.0030.01115.09
7.0.120.0040.00815.63
7.0.110.0100.00315.58
7.0.100.0070.00715.14
7.0.90.0030.00815.44
7.0.80.0030.01015.28
7.0.70.0030.00615.43
7.0.60.0080.00315.39
7.0.50.0060.00615.54
7.0.40.0070.00413.52
7.0.30.0080.00413.56
7.0.20.0000.01013.52
7.0.10.0000.01113.45
7.0.00.0030.01013.27
5.6.400.0070.00714.63
5.6.390.0040.01514.68
5.6.380.0000.01414.66
5.6.370.0000.01313.93
5.6.360.0040.01114.69
5.6.350.0090.00614.30
5.6.340.0040.01114.63
5.6.330.0060.00914.61
5.6.320.0000.01114.58
5.6.310.0090.00314.62
5.6.300.0120.00014.59
5.6.290.0080.00814.36
5.6.280.0040.00714.80
5.6.270.0040.00814.16
5.6.260.0000.00914.48
5.6.250.0100.00314.34
5.6.240.0070.00714.71
5.6.230.0100.00714.50
5.6.220.0100.00314.46
5.6.210.0030.00614.32
5.6.200.0040.00814.75
5.6.190.0060.00614.20
5.6.180.0030.01014.34
5.6.170.0040.00414.41
5.6.160.0000.01214.25
5.6.150.0090.00314.47
5.6.140.0100.00314.45
5.6.130.0030.01414.43
5.6.120.0030.01414.48
5.6.110.0000.01714.32
5.6.100.0070.00714.26
5.6.90.0100.00314.83
5.6.80.0070.00314.09
5.6.70.0060.00614.27
5.6.60.0070.00714.18
5.6.50.0110.00314.32
5.6.40.0000.01214.41
5.6.30.0060.00614.28
5.6.20.0000.01414.28
5.6.10.0060.00914.14
5.6.00.0090.00614.04

preferences:
165.81 ms | 403 KiB | 5 Q