Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Foo
- {
- const XXX_CONST = "abc";
- public static function printSelfOut()
- {
- var_dump(self::XXX_CONST);
- }
- public static function printStaticOut()
- {
- var_dump(static::XXX_CONST);
- }
- }
- class Bar extends Foo
- {
- const XXX_CONST = "123";
- }
- Foo::printSelfOut(); // Print out: abc
- Foo::printStaticOut(); // Print out: abc
- Bar::printSelfOut(); // Print out: abc
- Bar::printStaticOut(); // Print out: 123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement