Last active
June 18, 2022 13:40
-
-
Save atakde/a2483d250ef09438e48592ee928a07a6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
abstract class Debugger | |
{ | |
abstract public function debug($message); | |
} | |
class BrowserDebugger extends Debugger | |
{ | |
public function debug($message) | |
{ | |
echo "<pre>"; | |
print_r($message); | |
echo "</pre>"; | |
} | |
} | |
class CLIDebugger extends Debugger | |
{ | |
public function debug($message) | |
{ | |
print_r($message); | |
} | |
} | |
$debugger = new CLIDebugger(); | |
$debugger->debug(array('foo' => 'bar')); | |
$debugger = new BrowserDebugger(); | |
$debugger->debug(array('foo' => 'bar')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment