Mario M.
Mario M.

Reputation: 416

"Corrupt member variable name" in PHP trying to access to a static function

"Corrupt member variable name" exception is throw trying to access to a static function:

class CachedSettings
{
    static private $c;

    static private function getCacheInstance() 
    {
        if(!isset(self::$c)) self::$c = phpFastCache();
        return self::$c;
    }

    static public function getGroup($groupName) 
    {
        $cache = CachedSettings::getCacheInstance();
        ...

I've tried with self::, with the same result. Looks like it's not a very common error. Any idea?

Upvotes: 2

Views: 227

Answers (1)

iSkore
iSkore

Reputation: 7553

So, I don't see anything wrong but you might want to check out your PHP version. They recently released 5.6.x. If your localhost is different version than your server or whatever, this might be the issue.

  1. Install PHP 5.6.X: curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
  2. Edit ~/.bash_profile: open -a TextEdit ~/.bash_profile
  3. Add path at bottom of .bash_profile: export PATH=/usr/local/php5/bin:$PATH
  4. Make bash_profile finalized: source ~/.bash_profile
  5. Double check PHP 5.6.X is working: php -v

If you need some more assistance on upgrading

Hope this helps,

Upvotes: 1

Related Questions