Skip to content

Commit f6f26ad

Browse files
Create index9.php
1 parent 2c6f397 commit f6f26ad

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
function getUniqueComments():array
4+
{
5+
$pullRequests = include("pullRequests.php");
6+
7+
$filter = "changed";
8+
9+
$changedPullRequests = array_filter($pullRequests, function($pr) use ($filter){
10+
return ($pr['fileStatus'] == $filter);
11+
});
12+
13+
$allComments = [];
14+
15+
foreach ($changedPullRequests as $cpr) {
16+
$allComments[] = $cpr["comments"];
17+
}
18+
19+
$nonNullComments = array_filter($allComments);
20+
21+
$uniqueComments = array_unique($nonNullComments);
22+
23+
return $uniqueComments;
24+
25+
}
26+
27+
$start = microtime(true);
28+
29+
$uniqueComments = getUniqueComments();
30+
31+
// var_dump($uniqueComments);
32+
33+
// echo microtime(true) - $start; 0.0016169548034668 microseconds

0 commit comments

Comments
 (0)