Created
February 26, 2015 09:44
-
-
Save ariellephan/12e6a9b11756c589024a to your computer and use it in GitHub Desktop.
loose interface vs abstract in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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