<?php
abstract class PageObject
{
const X = "Don't print this";
public function __construct()
{
echo static::__CLASS__;
}
}
class Test extends PageObject
{
const X = "OMG";
}
$x = new Test;
Fatal error: Uncaught Error: Undefined constant Test::__CLASS__ in /in/VfcL7:9
Stack trace:
#0 /in/VfcL7(19): PageObject->__construct()
#1 {main}
thrown in /in/VfcL7 on line 9
Process exited with code 255.
Fatal error: Uncaught Error: Undefined class constant '__CLASS__' in /in/VfcL7:9
Stack trace:
#0 /in/VfcL7(19): PageObject->__construct()
#1 {main}
thrown in /in/VfcL7 on line 9
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Parse error: syntax error, unexpected '__CLASS__' (T_CLASS_C) in /in/VfcL7 on line 9
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected '__CLASS__' (T_CLASS_C), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/VfcL7 on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_CLASS_C, expecting T_STRING or T_VARIABLE or '$' in /in/VfcL7 on line 9
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC in /in/VfcL7 on line 9
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STATIC in /in/VfcL7 on line 9
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/VfcL7 on line 3
Process exited with code 255.