We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b374ba commit c4e4e98Copy full SHA for c4e4e98
tests/await/018-awaitAll_double_free.phpt
@@ -21,12 +21,26 @@ for ($i = 1; $i <= 100; $i++) {
21
22
$results = awaitAll($coroutines);
23
24
+// Check that we got all results
25
+$countOfResults = count($results) == 100 ? "OK" : "FALSE: ".count($results);
26
+echo "Count of results: $countOfResults\n";
27
+
28
+// Check that results are not null
29
+$nonNullCount = 0;
30
foreach ($results as $result) {
31
+ if ($result !== null) {
32
+ $nonNullCount++;
33
+ }
34
unset($result); // intentionally unset to trigger double free
35
}
36
37
+$nonNullResults = $nonNullCount == 100 ? "OK" : "FALSE: $nonNullCount";
38
+echo "Non-null results: $nonNullResults\n";
39
40
echo "end\n";
41
?>
42
--EXPECT--
43
start
44
+Count of results: OK
45
+Non-null results: OK
46
end
0 commit comments