- class List {
- public function hello()
- {
- return "hello";
- }
- }
-
- $list = new List;
-
- echo $list::hello();
@H_
301_3@给出
错误:
- PHP Parse error: Syntax error,unexpected 'List' (T_LIST),expecting identifier (T_STRING) in /home/WtGTRQ/prog.PHP on line 3
@H_
301_3@将“List”更改为“Lizt”可以
解决问题.
@H_
301_3@我遗憾地理解
Php functions are case-insensitive,但我真的不想让List对象成为一个Lizt对象…有没有办法绕过这个而不
重命名我的类?