Created
August 10, 2011 13:49
-
-
Save lleitep3/1136843 to your computer and use it in GitHub Desktop.
Late Static Bindings
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 | |
class A { | |
public static function who() { | |
echo get_called_class(); | |
} | |
public static function whoParent() { | |
echo get_parent_class(get_called_class()); | |
} | |
public static function test() { | |
self::who(); | |
self::whoParent(); | |
} | |
} | |
class B extends A { | |
} | |
B::test(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment