类名“::”方法名,php5.4以后,方法必须是静态

采用 类名::方法 的方式调用成员方法时报错: Strict standards: Non-static method abc::test() should be called statically in..

class abc
	{
		public function test(){
			echo "this is test";
		}
	}
echo Person::say();

采用 类名::方法 的方式调用成员方法时报错: Strict standards: Non-static method abc::test() should be called statically in..

原因是php不提倡静态调用非静态方法,将public function test()改为public static function test() 就不报错了

作者: 二皮

Hackers please go away