Recently found in class to assign a value to a private variable call the function will be error, not its interpretation, OOP, novice, please master explanation?
Class Test extends Controller { //test Private $test = count (' csdn ');}
Parse error:syntax Error, unexpected ' (', expecting ', ' or ';
Reply to discussion (solution)
The test was wrongly written, it was a string length
Class Test extends Controller { //test private $test = strlen (' csdn ');}
Recently found in class to assign a value to a private variable call the function will be error, not its interpretation, OOP, novice, please master explanation?
Class Test extends Controller { //test Private $test = count (' csdn ');}
Parse error:syntax Error, unexpected ' (', expecting ', ' or ';
This is not the reason for the private property
Instead, the class attribute cannot be given an indeterminate value when declaring!
Define (' Test ', strlen (' csdn ')), class Test extends Controller { //test private $test = test;}
It's possible to write like this.
Thanks, thanks.
This is not the reason for the private property
Instead, the class attribute cannot be given an indeterminate value when declaring!
Educated.
Define (' Test ', strlen (' csdn ')), class Test extends Controller { //test private $test = test;}
It's possible to write like this.