Hi Andreas,

Le jeu. 9 juil. 2015 à 17:35, Andreas Heigl <andr...@heigl.org> a écrit :

> Hi Patrick.
>
> Am 09.07.15 um 16:58 schrieb Patrick ALLAERT:
> > Hello list,
> >
> > Today I am facing a rather strange PHP error message on a production
> system
> > using PHP 5.4.41 with APC:
> >
> > [09-Jul-2015 15:06:43 Europe/Brussels] PHP Fatal error:  Access to
> > undeclared static property:
> >
> Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php
> > in /opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Item.php
> > on line 348
> >
> > That line 348 is this one:
> > https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L348
> > and contains:
> > $cacheTime = self::$cacheTime;
> >
> > $cacheTime being defined in the class as:
> > public static $cacheTime = 432000; // five days
> > (see:
> https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L59)
> >
> > A message like:
> > "Fatal error:  Access to undeclared static property:
> > Stash\Item::$cacheTime" is virtually possible, but:
> > "Fatal error:  Access to undeclared static property:
> >
> Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php"
> > ?
> >
> > How is it possible that the filename of the file containing the interface
> > being used by that class appears instead of the variable?
> >
> > Any clue of what happened? PHP bug, APC one? Memory corruption? Bad karma
> > or planets wrongly aligned?
>
> Bad Parameter handling? Or am I missing the declaration of the
> $cacheTime Variable in or before the else-block?
>

There is two things: $cacheTime as a local variable to that function. And
self::$cacheTime that has **nothing** to do with the local variable and
that is declared at the top of the class.


> So efectively you assign $cacheTime = self::void
>

Nope, and "I" am not, Stash is a commonly used 3rd party caching library.


> Not sure whether that's a good idea in the first place.... ;)
>
> Cheers
>
> Andreas
> >
> > Cheers,
> > Patrick
>

Reply via email to