-
-
Save sgolemon/300914ca75ca25a6f35f104d26907c88 to your computer and use it in GitHub Desktop.
Abstract Constant
This file contains 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
<?php | |
abstract class FooBase { | |
abstract const BAR; | |
public static function getBar() { | |
return static::BAR; | |
} | |
} | |
class Foo extends FooBase { | |
const BAR = 'baz'; | |
} | |
var_dump(Foo::getBar()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NoGodPleaseNo.gif