Created
November 15, 2013 14:51
-
-
Save ftdebugger/7485511 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 | |
class Lamp | |
{ | |
public function turnOn() | |
{ | |
echo "I'm bright and cheerful light.\n"; | |
} | |
public function turnOff() | |
{ | |
echo "I am quiet and peaceful shadow\n"; | |
} | |
} | |
$lamp = new Lamp(); | |
if ($argv[1] == 'ON') { | |
$lamp->turnOn(); | |
} else { | |
if ($argv[1] == 'OFF') { | |
$lamp->turnOff(); | |
} else { | |
throw new \RuntimeException('I understand only ON/OFF command'); | |
} | |
} |
xeoncross
commented
Nov 15, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment