Skip to content

Instantly share code, notes, and snippets.

@dionyziz
Created November 25, 2013 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dionyziz/7636470 to your computer and use it in GitHub Desktop.
Save dionyziz/7636470 to your computer and use it in GitHub Desktop.
<?php
class A {
public function __construct() {
echo "I am an A\n";
}
public static function bar() {
new static();
}
}
class B extends A {
public function __construct() {
echo "I am a B\n";
}
public static function foo() {
parent::bar();
}
}
B::foo();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment