- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.18, 5.5.0 - 5.5.2
- Fatal error: Cannot redeclare t::getA() in /in/9dS7C on line 16
Process exited with code 255.
<?php
class t {
const A = 1;
function __construct() {
$r = new ReflectionClass($this);
var_dump($r->hasConstant('A'));
var_dump($r->hasConstant('c'));
var_dump($r->hasConstant('A'), self::A);
}
protected function getA() {
return self::A;
}
protected function getA() {
return self::B;
}
}
class s extends t {
const A = 2;
const B = 3;
function __construct() {
$r = new ReflectionClass($this);
var_dump($r->hasConstant('A'), self::A, $this->getA());
}
}
$t = new t;
$s = new s;