Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103493 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97611 invoked from network); 25 Nov 2018 08:40:11 -0000 Received: from unknown (HELO mail-it1-f172.google.com) (209.85.166.172) by pb1.pair.com with SMTP; 25 Nov 2018 08:40:11 -0000 Received: by mail-it1-f172.google.com with SMTP id x19so23613950itl.1 for ; Sat, 24 Nov 2018 21:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iNYdEa06qeZq6S9KyEJdUNzFnz2Xhq3Ud4QYMfb+HpE=; b=kBt9cihOsciCqNhKVKtFewTV6DtNfIhy9sGNlK3zDjpqhPetfTeVue/Xrw2eTHMM9v GB/j2B/y+weKHxQ4kb9iPKY1yt/Jf4HOSh6IAIz0tCLL2EYrlCmvnhtTCxh+DY2+IDUA gTsjC2tTG5yN0pGgzNpramieSQOfMAdAV1jwv+Gerv3NpTr5WWor24At6miuGfoJbiPC h9eU533ygcHmxv9Cfvfp5WzQvyFgER42Akjh3yw7vBtQ0+J29U74Y419HDPG+cesKLAJ 5dQ5EzxxDk0Mk9SN6XE4KWVOd7EYjk0UH9GWGiHN+dA0TWOtN8v5yF9HHOwQFkhTXuAu jtAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iNYdEa06qeZq6S9KyEJdUNzFnz2Xhq3Ud4QYMfb+HpE=; b=a3PcCV2qHguaBlO3jnNXprnTc+G4Ki2V9/2JDfPbc+4Hci5ygz0lSUm8MdymCHMzuI i+sre+q4NdtsvXmDNKmvEs+EGmE0yLRQACNbnXHFwBaqLg4RKoC1dPwIrQL47bK1foQp 5+oNxjuOY+FkdzYpOZdcbHi0vj3AKYeNkCcbGLSNYR5bWFqBiajfX5AlmGbrtxB+ambj hbk8guKEzgHqy81ekH8FpMqhTAsAv0EUZzQ7O+JScTPPTNcyE2aI93m+jRh79FC0fCVT QZ+L/AzK/ZXAQ4TN/m+FxaTnzddTPH3c8FG2Zhnf9A4zFqBfGawk+2fLl5y9IIGlv5vq sNew== X-Gm-Message-State: AGRZ1gIac72MUBsG2T49v9M5Zh/T7O3hi8yfeODpnBZFyhKL9kuiNIhS nkoGjfgD3EffyAtTxB0XLnESIL7hdvm8p4v4B7Y= X-Google-Smtp-Source: AFSGD/X72C6w4c+KM8SYqH80/r/lAr2XBYiQoR2hYDl5xVzbmDE82opKyRhbSkF+EGDlhRsKCfb7XKCnfC7LCQoQhGY= X-Received: by 2002:a24:750f:: with SMTP id y15mr17822750itc.177.1543122194439; Sat, 24 Nov 2018 21:03:14 -0800 (PST) MIME-Version: 1.0 References: <1cb7fecd-22ba-0ded-5bd6-e70208053012@gmail.com> <7f65012b-e26a-fb58-718b-b35569e53d03@gmail.com> In-Reply-To: <7f65012b-e26a-fb58-718b-b35569e53d03@gmail.com> Date: Sun, 25 Nov 2018 06:03:01 +0100 Message-ID: To: Stanislav Malyshev Cc: Rowan Collins , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000003eaac3057b7622f3" Subject: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)" From: ocramius@gmail.com (Marco Pivetta) --0000000000003eaac3057b7622f3 Content-Type: text/plain; charset="UTF-8" Adding to the pile of "it's an edge case", since the preload scripts will be procedural, wouldn't it be sufficient to call `opcache_invalidate(__FILE__)` at the end of them? On Sat, 24 Nov 2018, 20:57 Stanislav Malyshev Hi! > > >> 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, this makes sense. Though usually such file would be rather small > and adding whole new directive just for it may not be that necessary, I > think. > > > 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 > > Yes, that's what I am wondering too - how things defined directly in > preload file then will be treated? While file itself is not useful later > in server's lifetime, the things defined in it - like classes or > functions - can be? > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0000000000003eaac3057b7622f3--