3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Anagrafica { private $contactableFrom; private $contactableTo; public function getContactableFrom () { return $this->contactableFrom; } public function setContactableFrom ($cF) { $this->contactableFrom = $cF; } public function getContactableTo () { return $this->contactableTo; } public function setContactableTo ($cT) { $this->contactableTo = $cT; } } $anagrafica = new Anagrafica(); $anagrafica->setContactableFrom(null); $anagrafica->setContactableTo(null); $contactableFrom = ($anagrafica->getContactableFrom()) ? $anagrafica->getContactableFrom()->format('His') : '080000'; $contactableTo = ($anagrafica->getContactableTo()) ? $anagrafica->getContactableTo()->format('His') : '220000'; $currentTime = (new \DateTime())->format('His'); if ($currentTime < $contactableFrom || $currentTime > $contactableTo) { echo 'false'; } else { echo 'true'; }
Output for git.master, git.master_jit, rfc.property-hooks
true

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
52.59 ms | 401 KiB | 8 Q