diff options
| -rw-r--r-- | tests/classes/constants_scope_001.phpt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/classes/constants_scope_001.phpt b/tests/classes/constants_scope_001.phpt index 5dc874872e..50066282ea 100644 --- a/tests/classes/constants_scope_001.phpt +++ b/tests/classes/constants_scope_001.phpt @@ -11,15 +11,28 @@ class ErrorCodes { const INFO = "Informational message\n"; static function print_fatal_error_codes() { - echo "FATAL = " . FATAL; + echo "FATAL = " . FATAL . "\n"; echo "self::FATAL = " . self::FATAL; } } +class ErrorCodesDerived extends ErrorCodes { + const FATAL = "Worst error\n"; + static function print_fatal_error_codes() { + echo "self::FATAL = " . self::FATAL; + echo "parent::FATAL = " . parent::FATAL; + } +} + /* Call the static function and move into the ErrorCodes scope */ ErrorCodes::print_fatal_error_codes(); +ErrorCodesDerived::print_fatal_error_codes(); ?> ---EXPECT-- -FATAL = Fatal error +--EXPECTF-- + +Notice: Use of undefined constant FATAL - assumed 'FATAL' in %sconstants_scope_001.php on line %d +FATAL = FATAL self::FATAL = Fatal error +self::FATAL = Worst error +parent::FATAL = Fatal error |
