When accessing the member variables or methods in the PHP class, if the referenced variables or methods are declared as const (defining constants) or static (declaring static), the operator must be used:: If the referenced variable or method is not declared as const or static, the operator-must be used -. In addition, if the internal access to const from the class changes
When accessing the member variables or methods in the PHP class, if the referenced variables or methods are declared as const (defining constants) or static (declaring static), the operator must be used:: If the referenced variable or method is not declared as const or static, the operator-must be used -. In addition, if the internal access to const from the class changes
When accessing the member variables or methods in the PHP class, if the referenced variables or methods are declared as const (defining constants) or static (declaring static), the operator must be used:: If the referenced variable or method is not declared as const or static, the operator-> must be used.
In addition, if you access the const variable, static variable, or static method from inside the class, you must use self, otherwise, if the internal access from the class is not a const or static variable or method, you must use the self-referenced $ this
1: in strong language, variables, functions, and class names are case sensitive. js is case sensitive, but PHP is a bit different:
$ A = "x123 ";
$ A = "y123 ";
Echo $ a. "\ n ";
Echo $;
?>
Everyone knows the output result;
2:
Class registry {
Protected $ x = 'you ';
Function test (){
Return $ this-> x;
}
}
$ C = new Registry ();
$ C-> TEST ();
This method is case-insensitive in the class.
2:
Sometimes when var_dump is used to debug the array output, the lower-level array cannot be displayed, and the ellipsis is shown below in php. restart the service added to the xdebug node of ini. Configure the field as needed.
Xdebug. var_display_max_children = 128
Xdebug. var_display_max_data = 1024
Xdebug. var_display_max_depth = 15
3:
$ Str = "method ";
Echo $ str {0}; // The output here is m
Echo $ str {2}; // The output here is t
?>
Here {} is equivalent to [], and the effect is the same.
4:
$ A = 10; $ B = 10; $ c = 11;
$ A = $ B $ c = 19;
Echo $ c; // $ c = 19
For js:
Console. log (5 = '5' & 6 | 7 );
Change output 6 to 5 = 10, and output 7.