This thing is bugging me a lot. I’m getting Parse error: syntax error, unexpected ‘.’, expecting ‘,’ or ‘;’ at this line
public static $user_table = TABLE_PREFIX . 'users';
TABLE_PREFIX is a constant created by define function
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Static class properties are initialized at compile time. You cannot use a constant
TABLE_PREFIXto concatenate with a string literal when initializing a static class property, since the constant’s value is not known until runtime. Instead, initialize it in the constructor:https://www.php.net/manual/en/language.oop5.static.php
Update for PHP >= 5.6
PHP 5.6 brought limited support for expressions: