Hey Everyone, I am getting a weird error message all of the sudden on my page and I don't know why? Any help would be greatly appreciated! ERROR MESSAGE -------------------- Strict Standards: Accessing static property Posts::$sessionholder as non static CODE ITS REFERENCING ---------------------------- class Posts { public static $sessionholder; function __construct() { $this->sessionholder = $_SESSION; } ----------------------- Any ideas what could be causing this?
Hi, the class property $sessionholder is declared as 'static', which means it is associated with the class itself, rather than with the object you initialize by __construct. In this case, I believe you want to remove the keyword 'static' from the $sessionholder declaration (http://www.php.net/manual/en/language.oop5.static.php). It will suppress the error message. Also, if you didn't previously see this message, you should consider disabling display_errors directive - http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors or changing error_reporting level.