Created
April 12, 2015 08:58
-
-
Save kjohnson/0b263f12d3c2054ea627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class test { | |
| const HELLO = 'Hello'; | |
| } | |
| class test1 extends test { | |
| const HELLO = 'Hello, test1'; | |
| } | |
| class test2 extends test { | |
| const HELLO = 'Hello, test2'; | |
| } | |
| $test = new test(); | |
| $test1 = new test1(); | |
| $test2 = new test2(); | |
| echo $test::HELLO . "\r\n"; | |
| echo $test1::HELLO . "\r\n"; | |
| echo $test2::HELLO . "\r\n"; | |
| /** | |
| * RESULT | |
| * ------------ | |
| * Hello | |
| * Hello, test1 | |
| * Hello, test2 | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment