<?php
namespace Ref;
interface I
{
const I = 'I';
}
class A implements I
{
const A = 'A';
public function __construct() {}
}
class B extends A
{
const B = 'B';
public $public = 'public';
protected static $publicStatic;
}
$r = new \ReflectionClass('Ref\B');
//$r->getProperty('publicStatic')->setAccessible(true);
var_dump($r->getStaticPropertyValue('public'));
Fatal error: Uncaught ReflectionException: Property Ref\B::$public does not exist in /in/GSL8e:28
Stack trace:
#0 /in/GSL8e(28): ReflectionClass->getStaticPropertyValue('public')
#1 {main}
thrown in /in/GSL8e on line 28
Process exited with code 255.
Fatal error: Uncaught ReflectionException: Class Ref\B does not have a property named public in /in/GSL8e:28
Stack trace:
#0 /in/GSL8e(28): ReflectionClass->getStaticPropertyValue('public')
#1 {main}
thrown in /in/GSL8e on line 28
Process exited with code 255.
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Ref\B does not have a property named public' in /in/GSL8e:28
Stack trace:
#0 /in/GSL8e(28): ReflectionClass->getStaticPropertyValue('public')
#1 {main}
thrown in /in/GSL8e on line 28
Process exited with code 255.