3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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; } } class s extends t { const A = 2; function __construct() { $r = new ReflectionClass($this); var_dump($r->hasConstant('A'), self::A, $this->getA()); } } $t = new t; $s = new s;
Output for 5.3.0 - 5.4.18
Parse error: syntax error, unexpected '{', expecting '(' in /in/ngAGr on line 12
Process exited with code 255.