3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Demo { public function __construct(DateTimeInterface $dateTime) { $this->date = $dateTime; } public function getDateTime(): DateTimeInterface { return $this->date; } public function echo() { echo $this->date->format("d/m/Y h:i:s"); } } $demo = new Demo(new DateTime()); $demo->echo()."\n"; $demo->getDateTime()->add(new DateInterval('+1D')); $demo->echo();
Output for git.master, git.master_jit
Deprecated: Creation of dynamic property Demo::$date is deprecated in /in/ATBao on line 5 30/10/2018 10:29:55 Fatal error: Uncaught Exception: Unknown or bad format (+1D) in /in/ATBao:13 Stack trace: #0 /in/ATBao(13): DateInterval->__construct('+1D') #1 {main} thrown in /in/ATBao on line 13
Process exited with code 255.
Output for rfc.property-hooks
Deprecated: Creation of dynamic property Demo::$date is deprecated in /in/ATBao on line 5 30/10/2018 10:29:55 Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (+1D) in /in/ATBao:13 Stack trace: #0 /in/ATBao(13): DateInterval->__construct('+1D') #1 {main} thrown in /in/ATBao on line 13
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:
42.06 ms | 401 KiB | 8 Q