Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87091 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64196 invoked from network); 9 Jul 2015 16:14:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jul 2015 16:14:17 -0000 Authentication-Results: pb1.pair.com header.from=patrickallaert@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.46 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 209.85.215.46 mail-la0-f46.google.com Received: from [209.85.215.46] ([209.85.215.46:35562] helo=mail-la0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/33-22102-7DD9E955 for ; Thu, 09 Jul 2015 12:14:16 -0400 Received: by labgy5 with SMTP id gy5so97203718lab.2 for ; Thu, 09 Jul 2015 09:14:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=1+71VlHkbkJviyc7VBnlmUNi2mOen9y+mr0XiMuir8c=; b=MX9VtqpcPf347T8Nr5yXq9G3XOC99kKc7i/U5ttm5fisE2LWhOBxR902DbJvLtLIPN hoorI609ApT8SBLZdChRkLzl+KT9I3h1ps4gDqXV5ozp3OgEGWyAL9sVtd5o7/VlcM84 tx5xpt4I337kvdZ2F79a0eldkihCTw/9gDc2z/q/KGkNlAXXZ9uarxUjy7s3Q89EO7RI rx2vGAskUvlFSMcw3/3Yc3LkewxE+WpFjcIhvjRqp6TULDpznj+wOEsNf+tqwhj09GXg ww+gbkx9DVesAz9VND8NgG41FqAK32c6dP6ruMWjC+Yf0cLDaNf0cLvZg7WWDx+q47uz efMw== X-Received: by 10.112.180.37 with SMTP id dl5mr9344987lbc.108.1436458452427; Thu, 09 Jul 2015 09:14:12 -0700 (PDT) MIME-Version: 1.0 References: <559E94D2.8050401@heigl.org> In-Reply-To: <559E94D2.8050401@heigl.org> Date: Thu, 09 Jul 2015 16:14:02 +0000 Message-ID: To: Andreas Heigl , PHP Development Cc: Olivier Garcia Content-Type: multipart/alternative; boundary=089e01183346caab75051a738b1a Subject: Re: [PHP-DEV] Very strange error message From: patrickallaert@php.net (Patrick ALLAERT) --089e01183346caab75051a738b1a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Andreas, Le jeu. 9 juil. 2015 =C3=A0 17:35, Andreas Heigl a =C3= =A9crit : > 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/Stas= h/Interfaces/ItemInterface.php > > in /opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Item.p= hp > > on line 348 > > > > That line 348 is this one: > > https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L348 > > and contains: > > $cacheTime =3D self::$cacheTime; > > > > $cacheTime being defined in the class as: > > public static $cacheTime =3D 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/Stas= h/Interfaces/ItemInterface.php" > > ? > > > > How is it possible that the filename of the file containing the interfa= ce > > being used by that class appears instead of the variable? > > > > Any clue of what happened? PHP bug, APC one? Memory corruption? Bad kar= ma > > 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 =3D 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 > --089e01183346caab75051a738b1a--