Skip to content

Commit 7b502d7

Browse files
committed
If JIT support has not been compiled opcache_get_status does not return any JIT keys
1 parent 28e9958 commit 7b502d7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Management/Actions/Index.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ public function __invoke(ServerRequestInterface $request): Response
6262
<dt>Opcache Statistics</dt>
6363
<dd>{$this->fn(implode('</dd><dd>', array_map(function($v1, $v2) {return sprintf('%s=%s', $v1, $v2); }, array_keys($opcache_status['opcache_statistics']), array_values($opcache_status['opcache_statistics']))))}</dd>
6464
<dt>JIT Statistics</dt>
65-
<dd>{$this->fn(implode('</dd><dd>', array_map(function($v1, $v2) {return sprintf('%s=%s', $v1, $v2); }, array_keys($opcache_status['jit']), array_values($opcache_status['jit']))))}</dd>
66-
</dl>
6765
EOH;
68-
66+
if (($opcache_status['jit'] ?? null) === null) {
67+
$opcache_html .= "<dd>Not Available</dd>";
68+
} else {
69+
$opcache_html .= "<dd>" . implode('</dd><dd>', array_map(function($v1, $v2) {return sprintf('%s=%s', $v1, $v2); }, array_keys($opcache_status['jit']), array_values($opcache_status['jit']))) . "</dd>";
70+
}
71+
$opcache_html .= "</dl>";
6972
}
7073

7174
$body = <<<EOT

0 commit comments

Comments
 (0)