We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 285325c commit 6cc453bCopy full SHA for 6cc453b
1 file changed
benchmark/benchmark.php
@@ -150,11 +150,8 @@ function runValgrindPhpCgiCommand(
150
* @return decimal-int-string
151
*/
152
function extractInstructionsFromValgrindOutput(string $output): string {
153
- if (!preg_match("(==[0-9]+== Events : Ir\n==[0-9]+== Collected : (?<instructions>[0-9]+))", $output, $matches)) {
154
- throw new \Exception('Unexpected valgrind output');
155
- }
156
-
157
- return $matches['instructions'];
+ preg_match("(==[0-9]+== Events : Ir\n==[0-9]+== Collected : (?<instructions>[0-9]+))", $output, $matches);
+ return $matches['instructions'] ?? throw new \Exception('Unexpected valgrind output');
158
}
159
160
main();
0 commit comments