We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c6f397 commit f6f26adCopy full SHA for f6f26ad
9. Nitpicking a Pull Request/imperative/index9.php
@@ -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