On Mon, 26 Nov 2018 at 09:15, Zeev Suraski <vsura...@gmail.com> 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]

Reply via email to