Skip to content

Instantly share code, notes, and snippets.

@earth3300
Last active August 24, 2018 19:16
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 earth3300/2d3d7454bcd8c2a8ee86835361d29295 to your computer and use it in GitHub Desktop.
Save earth3300/2d3d7454bcd8c2a8ee86835361d29295 to your computer and use it in GitHub Desktop.
<?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