Skip to content

Instantly share code, notes, and snippets.

@balibali
Created May 18, 2012 08:45
Show Gist options
  • Save balibali/2724046 to your computer and use it in GitHub Desktop.
Save balibali/2724046 to your computer and use it in GitHub Desktop.
PHP 5.3 で後方互換性がなくて Fatal error になるやつ
<?php
class A {
function A() { echo "bar\n"; }
}
class B extends A {}
class C extends B {}
class D extends C {
function D() {
parent::__construct();
parent::A();
parent::C();
parent::B(); // (PHP 5.3) Fatal error: Call to undefined method C::B()
}
}
new D();
@balibali
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment