클래스의 인스턴스를 만들지 않고 클래스에서 정적 속성을 가져 오는 방법이 있습니까?PHP 클래스에서 통계 가져 오기
$reflection = new ReflectionObject('Foo');
$staticProperties = $reflection->getStaticProperties();
이렇게하면 오류가 발생합니다.
ReflectionObject::__construct() expects parameter 1 to be object, string given in test.php on line 19
이 워드 프로세서 내가 문자열을 전달 할 수 있어야 보여줄 것 5.5 PHP ..
http://php.net/manual/en/reflectionclass.construct.php
Either a string containing the name of the class to reflect, or an object.
어떤 생각인가? 토큰을 파싱하지 않고도 파일을 가져오고 싶습니다.
대신 'ReflectionClass'을 사용하십시오. – PeeHaa
권자. 잠을 자지 못하면서 ... – Wizzard