Skip to content

Instantly share code, notes, and snippets.

@MadaraUchiha
Created September 25, 2012 22:31
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 MadaraUchiha/3784863 to your computer and use it in GitHub Desktop.
Save MadaraUchiha/3784863 to your computer and use it in GitHub Desktop.
Inheritance works fine
<?php
class A {
public function one() {
return $this->two();
}
public function two() {
return "A";
}
}
class B extends A {
public function two() {
return "B";
}
}
$b = new B;
echo $b->one(); //outputs B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment