Created
April 22, 2013 15:16
-
-
Save harikt/5435857 to your computer and use it in GitHub Desktop.
Copied from a nerd wedding invitation
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 Wedding | |
{ | |
protected $start; | |
protected $end; | |
public function __construct($start = '2013-04-22 09:45', $end = '2013-04-22 10:15') | |
{ | |
$this->start = $start; | |
$this->end = $end; | |
} | |
public function start() | |
{ | |
if (date('Y-m-d H:i') >= $this->start && date('Y-m-d H:i') <= $this->end) { | |
echo "Wedding bells!" . PHP_EOL; | |
echo "Hari weds Sangeetha" . PHP_EOL; | |
} | |
} | |
} | |
$wedding = new Wedding(); | |
$wedding->start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment