Skip to content

Instantly share code, notes, and snippets.

@ariellephan
Created February 26, 2015 09:44
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 ariellephan/12e6a9b11756c589024a to your computer and use it in GitHub Desktop.
Save ariellephan/12e6a9b11756c589024a to your computer and use it in GitHub Desktop.
loose interface vs abstract in php
interface Mail {
public function sendMail();
public function getFuel();
}
abstract class MyAbstractClass implements Mail {
function myAbstractFunction() {
echo "not abstract";
}
public function sendMail(){
echo 9;
}
}
class DetailClass extends MyAbstractClass {
function getFuel() {
echo 'finally get fuel';
}
}
$ok = new DetailClass();
$ok->getFuel();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment