We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4a2e33 commit d09ba21Copy full SHA for d09ba21
1 file changed
benchmark/benchmark.php
@@ -136,9 +136,15 @@ function runValgrindPhpCgiCommand(
136
return ['instructions' => $instructions];
137
}
138
139
+/**
140
+ * @return decimal-int-string
141
+ */
142
function extractInstructionsFromValgrindOutput(string $output): string {
- preg_match("(==[0-9]+== Events : Ir\n==[0-9]+== Collected : (?<instructions>[0-9]+))", $output, $matches);
- return $matches['instructions'] ?? throw new \Exception('Unexpected valgrind output');
143
+ if (!preg_match("(==[0-9]+== Events : Ir\n==[0-9]+== Collected : (?<instructions>[0-9]+))", $output, $matches)) {
144
+ throw new \Exception('Unexpected valgrind output');
145
+ }
146
+
147
+ return $matches['instructions'];
148
149
150
main();
0 commit comments