3v4l.org

run code in 300+ PHP versions simultaneously
<?php class appendiceHelper { public $document; public $documentDealer; public $documentDate; public $Luglio2015; public $Ottobre2015; public $special; public function __construct($dealer,$date) { $this->documentDealer = $dealer; $this->documentDate = new DateTime($date); $this->document = "pdf/appendice_EM.pdf"; $this->special = 0; $this->IsSpecial(); $this->Luglio2015 = new DateTime(); $this->Luglio2015->setDate(2015, 7, 1); $this->Luglio2015->setTime(00, 01); $this->Ottobre2015 = new DateTime(); $this->Ottobre2015->setDate(2015, 10, 1); $this->Ottobre2015->setTime(00, 01); } private function IsSpecial() { //Dealer Stracciari - Authos if ($this->documentDealer == 882) $this->special = 1; if ($this->documentDealer == 1821) $this->special = 1; if ($this->documentDealer == 2633) $this->special = 1; if ($this->documentDealer == 3194) $this->special = 1; if ($this->documentDealer == 3206) $this->special = 1; if ($this->documentDealer == 3210) $this->special = 1; if ($this->documentDealer == 3218) $this->special = 1; if ($this->documentDealer == 3223) $this->special = 1; } public function getDocument() { $this->document = "pdf/app_cert_4.pdf"; $intervalLuglio2015 = $this->Luglio2015->diff($this->documentDate)->invert; $intervalOttobre2015 = $this->Ottobre2015->diff($this->documentDate)->invert; if($intervalOttobre2015 == 1) $this->document = "pdf/app_cert_2.pdf"; if($intervalLuglio2015 == 1) $this->document = "pdf/app_cert_1.pdf"; if($this->special == 1) { $this->document = "pdf/app_cert_5_special.pdf"; if($intervalOttobre2015 == 1) $this->document = "pdf/app_cert_3_special.pdf"; if($intervalLuglio2015 == 1) $this->document = "pdf/app_cert_1.pdf"; } return $this->document; } } $test = new appendiceHelper(1, new DateTime()) ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: DateTime::__construct(): Argument #1 ($datetime) must be of type string, DateTime given in /in/iiYSS:14 Stack trace: #0 /in/iiYSS(14): DateTime->__construct(Object(DateTime)) #1 /in/iiYSS(66): appendiceHelper->__construct(1, Object(DateTime)) #2 {main} thrown in /in/iiYSS on line 14
Process exited with code 255.

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:
47.02 ms | 401 KiB | 8 Q