{"id":7261,"date":"2014-06-03T23:26:23","date_gmt":"2014-06-03T23:26:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/php-syntax-error-unexpected-t_object_operator-collection-of-common-programming-errors\/"},"modified":"2014-06-03T23:26:23","modified_gmt":"2014-06-03T23:26:23","slug":"php-syntax-error-unexpected-t_object_operator-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/php-syntax-error-unexpected-t_object_operator-collection-of-common-programming-errors\/","title":{"rendered":"php syntax error, unexpected T_OBJECT_OPERATOR-Collection of common programming errors"},"content":{"rendered":"<p>what I did is, I used a static field in my Database class, to store mysqli object. here is the code :<\/p>\n<pre><code>public static $Driver;\n\npublic static function Connect()\n{\n  self::$Driver = new mysqli(self::$Server, self::$DBUsername, self::$DBPassword, self::$DBName);\n}\n<\/code><\/pre>\n<p>later, in another class, I want to use this static field. I tried this :<\/p>\n<pre><code>if (Database::Driver-&gt;errno != 0) return(false); else return(true);\n<\/code><\/pre>\n<p>and got this error for that line :<\/p>\n<blockquote>\n<p>syntax error, unexpected T_OBJECT_OPERATOR &#8230;<\/p>\n<\/blockquote>\n<p>can you tell me what I&#8217;m doing wrong?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>what I did is, I used a static field in my Database class, to store mysqli object. here is the code : public static $Driver; public static function Connect() { self::$Driver = new mysqli(self::$Server, self::$DBUsername, self::$DBPassword, self::$DBName); } later, in another class, I want to use this static field. I tried this : if (Database::Driver-&gt;errno [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7261","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7261"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7261\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}