Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103503 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5857 invoked from network); 26 Nov 2018 14:23:50 -0000 Received: from unknown (HELO mail-io1-f50.google.com) (209.85.166.50) by pb1.pair.com with SMTP; 26 Nov 2018 14:23:50 -0000 Received: by mail-io1-f50.google.com with SMTP id w7so13502326iom.12 for ; Mon, 26 Nov 2018 02:47:11 -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; bh=sWlXc6+sdJys6NFaLEbixhrAqVbGl+7qztN/auVI394=; b=sqoR5JJAL0BS3G71lJaT2eje3R7e8XFi/L81Q1NLDRKS0b1CzGq/vo3EVYyV0vXS/v fvKAoYkuzXUc0gXt7Nl13KVn4hpHPi3p23WZpG3a5ZOAVRrV8Pj2s8Z8jIgCBNYmAag7 xmddJNVm9FNM9rLf82L4QgdEFQyuMp5G0pZkiZqe03HlTEsjt+/Txy+6b+O5YdUj5XY3 WIh9XRoeUrV5UWGcjaFj0ZySAE7tpsNAU3cKCzNCOaFz94YbVQY0Gh3a1+i8K/UWKVvp iczE/D8ftluC+DDe7EZkmwJpnJdONrJn3GHpM6GR3H8q5yAm/G52ZSSjrs+kuudK6Ht/ Rn2g== 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; bh=sWlXc6+sdJys6NFaLEbixhrAqVbGl+7qztN/auVI394=; b=YivTrkwPEQi18OH4Z8xsuCjiAPU9eDuWp+fnuLHXjKqIa39asyjL/Cl9JXjxkqwoXy 8b487DTQ+wZusUYVuBTCYMROl2Zr4aTs65iU8rm5nC6U8jm7ZFGomHI4bIFBjlcXLFSU G38fwgeqI7X1KcwgeRvAYi2iFvmOSdYL077OYh1uPiwi1oO6dwTSreXN+3BiOXssMXcm S8evMRz8cR0SICyMpQ1mhO1XKHdyKuzXiTcy+VGsWaGEHgy1SDNOWfMwrEI0ikLdYP5J BVHlw+WnGMz+EZm0Gr7N9tmUf4gefFeeu2F40NYEEaOJ+Iez8qzPke1TaYAu8YRVU1SV AMCA== X-Gm-Message-State: AA+aEWZXPpjfZyajiJIxqvsh/Bpe8XfrloU+ueNGhtr3VCjOePn2HgP9 MMx02ry7g6cnFQdZeNNcI7btmKigrcWmo/7dV5z7nIxT X-Google-Smtp-Source: AFSGD/WjQ1pJhDkrxcuFZzFqPggygvobjBUNqpAyK9fma6AqdKREsMJBuixceO58BeoqpGW7BBrLtkggj5vLR5HhwGg= X-Received: by 2002:a6b:7402:: with SMTP id s2mr11767567iog.219.1543229231030; Mon, 26 Nov 2018 02:47:11 -0800 (PST) MIME-Version: 1.0 References: <1cb7fecd-22ba-0ded-5bd6-e70208053012@gmail.com> <7f65012b-e26a-fb58-718b-b35569e53d03@gmail.com> In-Reply-To: Date: Mon, 26 Nov 2018 10:46:59 +0000 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000001f672d057b8f0e9d" Subject: Re: [PHP-DEV] declare(cache=0) - explanation (was: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)") From: rowan.collins@gmail.com (Rowan Collins) --0000000000001f672d057b8f0e9d Content-Type: text/plain; charset="UTF-8" On Mon, 26 Nov 2018 at 09:15, Zeev Suraski wrote: > The goal of declare(cache=0) would be to avoid persisting utility > functions/classes that have to do with a particular preload.php > implementation - so that they don't become a part of the app's memory > context and 'pollute' its scope. > Thanks for the clarification, that makes a lot more sense than the performance impact. As I mentioned before, though, the behaviour of the following case is not obvious to me: # preload.php require 'foo.php'; require 'bar.php'; # foo.php declare(cache=0); class Foo {} # bar.php class Bar extends Foo {} At the time it is first parsed, Bar is a complete class, and is being defined during preload, so ought to be defined permanently; but it depends on Foo, which will not be cached. Will this be an error, or will class Bar simply not be defined on future requests? Regards, -- Rowan Collins [IMSoP] --0000000000001f672d057b8f0e9d--