Skip to content

Disable opcache per script using "declare(cache=0)" #3678

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

Closed
wants to merge 1 commit into from

Conversation

dstogov
Copy link
Member

@dstogov dstogov commented Nov 23, 2018

Allow "declare(cache=0)" syntax to disable sctipt caching in opcache (this also exclude files from preloading).

@friizer
Copy link

friizer commented Nov 23, 2018

How does it work with opcache_file_cache?

@petk petk added the Feature label Nov 23, 2018

if (FAILURE == zend_declare_is_first_statement(ast)) {
zend_error_noreturn(E_COMPILE_ERROR, "cache declaration must be "
"the very first statement in the script");
Copy link
Contributor

@Majkl578 Majkl578 Nov 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is a bit misleading, when cache=0 is used together with (and after) strict_types.

@ntzm
Copy link
Contributor

ntzm commented Nov 23, 2018

What's the use-case for this?

@Llbe
Copy link

Llbe commented Nov 23, 2018

Is it correct that this would work like opcache.blacklist_filename INI?

@staabm
Copy link
Contributor

staabm commented Nov 23, 2018

See also related discussion
https://externals.io/message/103480

@nikic
Copy link
Member

nikic commented Jan 11, 2019

Can this PR be closed? Based on the discussion, I think we wanted to solve this in a different way.

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

Successfully merging this pull request may close these issues.

8 participants