Last active
August 24, 2018 19:16
-
-
Save earth3300/2d3d7454bcd8c2a8ee86835361d29295 to your computer and use it in GitHub Desktop.
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
<?php | |
defined('NDA') || exit('Access denied.'); | |
/** | |
* Plugin Name: OOP Plugin | |
* Description: A very basic plugin using OOP (Interface, Abstract Class, Class and Function). | |
* Version: 2018.08.24 | |
* License: GPLv2+ | |
*/ | |
interface iInterface | |
{ | |
public function echoHello(); | |
public function returnHello(); | |
} | |
abstract class aClass implements iInterface | |
{ | |
public function returnHello() | |
{ | |
return "Hello"; | |
} | |
} | |
class cClass extends aClass | |
{ | |
public function echoHello() | |
{ | |
$hello = aClass::returnHello(); | |
echo $hello; | |
} | |
} | |
$oop = new cClass(); | |
$oop->echoHello(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment