From 66ef87421a63a7a8d114301a5c2b12eec96f5219 Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Sat, 8 Apr 2023 03:35:50 +0200 Subject: [PATCH 1/2] Fix opcache.jit validation --- src/Runtime.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Runtime.php b/src/Runtime.php index 2fd58ed..0efa806 100644 --- a/src/Runtime.php +++ b/src/Runtime.php @@ -73,7 +73,13 @@ public function performsJustInTimeCompilation(): bool return false; } - if (strpos(ini_get('opcache.jit'), '0') === 0) { + $jit = ini_get('opcache.jit'); + + if (($jit === 'disable') || ($jit === 'off')) { + return false; + } + + if (strrpos(ini_get('opcache.jit'), '0') === 3) { return false; } From 44ed52cfe13eea1ad12c9c9e74beadef5815a82c Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Sat, 8 Apr 2023 03:40:22 +0200 Subject: [PATCH 2/2] Reuse the $jit variable --- src/Runtime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runtime.php b/src/Runtime.php index 0efa806..5dd4c19 100644 --- a/src/Runtime.php +++ b/src/Runtime.php @@ -79,7 +79,7 @@ public function performsJustInTimeCompilation(): bool return false; } - if (strrpos(ini_get('opcache.jit'), '0') === 3) { + if (strrpos($jit, '0') === 3) { return false; }