Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opcache.jit=off does not behave as documented #14267

Closed
siliconforks opened this issue May 19, 2024 · 0 comments
Closed

opcache.jit=off does not behave as documented #14267

siliconforks opened this issue May 19, 2024 · 0 comments

Comments

@siliconforks
Copy link

Description

According to the documentation for opcache.jit, the value disable means "Completely disabled, cannot be enabled at runtime", and the value off means "Disabled, but can be enabled at runtime".

But if you put the following values in your php.ini:

zend_extension=opcache
opcache.jit=off
opcache.jit_buffer_size=64M

...then you try to enable at runtime inside a .php file:

<?php
ini_set('opcache.jit', 'tracing');

...then you will get this:

Warning: Cannot change opcache.jit setting at run-time (JIT is disabled)

This is the same result you get if you set opcache.jit=disable.

As far as I can tell, the problem is that the code is looking for the literal string off but since that value is handled specially by PHP's ini parser, the code will never actually see a value of off. (It will never see no or false either.)

if (ZSTR_LEN(jit) == 0
|| zend_string_equals_literal_ci(jit, "disable")) {
JIT_G(enabled) = 0;
JIT_G(on) = 0;
return SUCCESS;
} else if (zend_string_equals_literal_ci(jit, "0")
|| zend_string_equals_literal_ci(jit, "off")
|| zend_string_equals_literal_ci(jit, "no")
|| zend_string_equals_literal_ci(jit, "false")) {
JIT_G(enabled) = 1;
JIT_G(on) = 0;
return SUCCESS;

PHP Version

PHP 8.3.7

Operating System

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants