Skip to content

Instantly share code, notes, and snippets.

@palpalani
Forked from harikt/wedding.php
Created June 22, 2013 05:29
Show Gist options
  • Save palpalani/5835974 to your computer and use it in GitHub Desktop.
Save palpalani/5835974 to your computer and use it in GitHub Desktop.
<?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