Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103491 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49319 invoked from network); 24 Nov 2018 16:56:26 -0000 Received: from unknown (HELO mail-wr1-f50.google.com) (209.85.221.50) by pb1.pair.com with SMTP; 24 Nov 2018 16:56:26 -0000 Received: by mail-wr1-f50.google.com with SMTP id z5so10299731wrt.11 for ; Sat, 24 Nov 2018 05:19:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=6eGMuTmy+19cA0Px7eC1Md9MnCON5jZIla+p9H7R74c=; b=gnRVS/GGEEcIArKymVA0fAZ4vWZLK9WRMrqr2pDYMIk+HkoZ6TWXY1Jrv7iBG8hBKw HeTuaJvCEK8+sdkwlklIrGVxq/GxKYIptUDoUPaxp7yG0nyZ96M6FVsEwPDcU9SLKo55 2068EU9CYmuOJVRAnkJjM8mXviPnm3R16KTaRHDMwFoP7fPVu4ZD2v1TaTCKrXD5haWy TAPOQ5gwty8Ya+B9dODG6uRCogqCZWlWZ24sUDehRn/zmTYrBT1kZSqEZNrDAZZFaZoV kH6f60ZFp8ftjecH0s5ZtcZlrVxx/iv9c1x+yRDSd1VZ25DE31gMtKvd5W3nN33UVG3o hz6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6eGMuTmy+19cA0Px7eC1Md9MnCON5jZIla+p9H7R74c=; b=sRTvQbP3SGRM9EeTNl1VPXNkyrBzw0VLFmsYU7fcPZ7gVcmUTo27cHcKdYQpN1iVqr ZfGpCYFUNrfj2w2r7x9+xLlDZ8pTBcyW603xYwp6cTVwx3w95c4u0jHxHeGrOnZk2PE2 B5xHsszsAprdP1F/U0Ic2gV4+XQ5sYwE7X/LVP2xovipKR/ANQuJ70nYgjqAsANu6/6L gNELAHRES+khg0mDbZH011cqHxaDukFj8MnUG0KLcO3EQMZeCPCpRPnSq6eb7Sw9k50v fM+PLBcxPXgv1E6a6290pvGxw6hgAd4IM+l28SBs/nzefMKMxBxeO9E5GZMDJtfjEZDc rWeg== X-Gm-Message-State: AA+aEWZl7U3R+GSx20uepKpmazkEJSGxBdwXMdVFGDtzHtlRY7uphRnN YrGSATA6xE8Lpl4AMSzCuJDgD+YN X-Google-Smtp-Source: AFSGD/V7TqiVq6ll7y4HOLIYRSqA8ONcz7icGBEEzdAKgJ7rXkqDbolnrPbQfxU9Oy+bAbtk94m8eA== X-Received: by 2002:a5d:4acb:: with SMTP id y11mr17183117wrs.281.1543065558174; Sat, 24 Nov 2018 05:19:18 -0800 (PST) Received: from [192.168.0.14] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id y13sm13886425wrw.85.2018.11.24.05.19.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Nov 2018 05:19:17 -0800 (PST) To: Internals References: Message-ID: <1cb7fecd-22ba-0ded-5bd6-e70208053012@gmail.com> Date: Sat, 24 Nov 2018 13:19:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)" From: rowan.collins@gmail.com (Rowan Collins) On 23/11/2018 23:49, Zeev Suraski wrote: > I'm not sure if you're missing anything fundamental - it's just that > the preload.php file Dmitry's referring to (the one that's responsible > to loading all the other files) - is one file that's pretty much by > definition, will be of no use at any later point in the lifetime of > the server.  It preloads other files (which of course, should very > much persist in the opcache memory) - but once it's done, it's done.  > That's why it kind of makes sense not to cache it. Ah, OK, so it's more a case of "don't bother caching" rather than "must avoid caching" then? I think making it automatically uncached might be a bit confusing, and a source of future "gotchas". While it's *logical* for the INI setting to reference a stub file with nothing but includes, the feature as described in the RFC doesn't actually *require* this; it would be perfectly possible for someone to put a bunch of definitions in "preloaded_functions.php" and reference that one file directly in the preload directive. On the flip side, it's likely that frameworks will start shipping with their own preload helpers, so that you'd have "preload_all.php" reference "symfony/preload.php", and want to exclude *both* from the cache. Thinking about it, I'm not clear exactly what a "do not cache" directive would mean in a preloaded file, since preloading is more than just caching. For instance, if "class A" is declared in a preloaded file with declare(cache=0), then "class B extends A" is declared in a preloaded file with caching enabled, how will class B be treated? Will the file containing class B be cached, but need to be referenced in an "include" statement in each request? Again, people will *probably* be using file structures and autoloaders that make this trivial, but the language doesn't require that. Regards, -- Rowan Collins [IMSoP]