Skip to content

Instantly share code, notes, and snippets.

@reaneyk
reaneyk / gist:6604607
Created September 18, 2013 04:39
Example PHP Interface class
<?php
//Define a new Interface for all 'shapes' to inherit
interface Shape {
//Define the methods required for classes to implement
public function getColor();
public function setColor($color);
@reaneyk
reaneyk / gist:6604523
Last active June 29, 2022 16:57
Example PHP Abstract Class
<?php
//Define a new Abstract class for all 'shapes' to extend
abstract class Shape {
//Define the methods required for classes to extend
//the abstract class
abstract protected function getColor();
abstract protected function setColor($color);