-
-
Save postadelmaga/005bb745358b4d91d9ddd71b63b5a285 to your computer and use it in GitHub Desktop.
This file contains 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 | |
final class Present | |
{ | |
protected $_is; | |
static protected $_now; | |
static protected $_time; | |
public function __construct() | |
{ | |
self::$_now = $this; | |
return $this; | |
} | |
protected function _is() | |
{ | |
return $this->_is; | |
} | |
public function getInstant() | |
{ | |
if ($this->_is) { | |
$this->_is = false; | |
return time(); | |
} | |
$this->_is = true; | |
$date = self::$_now->getInstant(); | |
return $date; | |
} | |
} | |
$time = new Present(); | |
echo $time->getInstant(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment