You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
strtok() fails to tokenize the input when passed a literal string when opcache is enabled #13145
The above code results in an infinite loop on PHP 8.3.x and master when opcache is enabled. It works as expected on PHP 8.1.x and 8.2.x with opcache enabled. It also works as expected when opcache is disabled on PHP 8.3.x and master.
If you change the example to use a variable as input instead of a literal string, then it works as expected on PHP 8.3.x and master when opcache is enabled.
Hi @TRowbotham! Thanks for the report. This seems to be optimization-related, since opcache.optimization_level=0 dodges the issue. I'll have a look today.
@SjonHortensius I think this commit is only scheduled for 8.3.3.
thanks - in that case we are experiencing another strtok issue wrt global state that only appeared in 8.3.2 but we're having trouble creating a testcase unfortunately. Will post a separate issue if we do
Activity
iluuu1994 commentedon Jan 14, 2024
Hi @TRowbotham! Thanks for the report. This seems to be optimization-related, since
opcache.optimization_level=0dodges the issue. I'll have a look today.strtok is not comptime
strtok is not comptime()
SjonHortensius commentedon Feb 13, 2024
@iluuu1994 your fix seems incomplete - with
8.3.2we are seeing other strange issues withstrtokand state interference.The above testcase (still) fails on
8.3.2when running under php-fpmiluuu1994 commentedon Feb 13, 2024
@SjonHortensius I think this commit is only scheduled for 8.3.3.
SjonHortensius commentedon Feb 13, 2024
thanks - in that case we are experiencing another
strtokissue wrt global state that only appeared in8.3.2but we're having trouble creating a testcase unfortunately. Will post a separate issue if we doiluuu1994 commentedon Feb 13, 2024
@SjonHortensius It's very likely that these are related. Can you try on 8.3.3?