Skip to content

Instantly share code, notes, and snippets.

@lleitep3
Created August 10, 2011 13:49
Show Gist options
  • Save lleitep3/1136843 to your computer and use it in GitHub Desktop.
Save lleitep3/1136843 to your computer and use it in GitHub Desktop.
Late Static Bindings
<?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