Re: [mini-RFC] Disable opcache per script using "declare(cache=0)"

From: Date: Fri, 23 Nov 2018 16:23:01 +0000
Subject: Re: [mini-RFC] Disable opcache per script using "declare(cache=0)"
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-103487@lists.php.net to get a copy of this message
On Fri, Nov 23, 2018 at 8:36 AM Pierre Joye <pierre.php@gmail.com> wrote: > > Especially, the main preload.php, usually should be marked, to disable > its > > caching. > > > > should this specific case not be done automatically then? > > I'm with Pierre on this. During the preload phase, we should probably have implicit caching disabled and only cache things brought in via opcache_compile_file(). Outside of the preload pragma, I'd worry that this declare would be mistakenly overused in most cases. Question though... who wins if a file is explicitly loaded with opcache_compile_file *and* it has the "don't cache me, bro" pragma? I'd expect the file wouldn't be cached in that case. That said, I'm of the "here's your gun, try not to shoot yourself" school on most things, and I see no harm in this when used judiciously, so no objections from me. -Sara

« previous php.internals (#103487) next »