Factory Pattern Simple Example

Run Settings
LanguagePHP
Language Version
Run Command
<?php interface Draw { public function drawNow(); } class Shape implements Draw { public $x; private $y; public function drawNow() { echo "Factory pattern example"; } } function callingNow(Draw $draw) { $draw->drawNow(); } $obj = new Shape(); // $obj->drawNow(); callingNow($obj);
Editor Settings
Theme
Key bindings
Full width
Lines