3v4l.org

run code in 500+ PHP versions simultaneously
<?php class UrlConcrete { /** * @param DateTimeInterface|DateTime|null $lastmod * * @return UrlConcrete */ public function setLastmod($lastmod = null) { if (!($lastmod instanceof \DateTimeInterface || $lastmod instanceof \DateTime)) { $typePassed = is_object($lastmod) ? \get_class($lastmod) : \gettype($lastmod); if (\PHP_MAJOR_VERSION >= 7) { throw new \TypeError('Argument 1 passed to ' . __METHOD__ . "() must be an instance of DateTimeInterface, '$typePassed' given"); } else { \trigger_error('Argument 1 passed to ' . __METHOD__ . "() must be an instance of DateTime, '$typePassed' given", E_USER_ERROR); return $this; } } $this->lastmod = $lastmod; return $this; } } $x = new UrlConcrete(); $x->setLastmod(new \DateTime()); $x->setLastmod(new stdclass());
Output for rfc.property-hooks, git.master, git.master_jit
Deprecated: Creation of dynamic property UrlConcrete::$lastmod is deprecated in /in/NHDnA on line 24 Fatal error: Uncaught TypeError: Argument 1 passed to UrlConcrete::setLastmod() must be an instance of DateTimeInterface, 'stdClass' given in /in/NHDnA:16 Stack trace: #0 /in/NHDnA(32): UrlConcrete->setLastmod(Object(stdClass)) #1 {main} thrown in /in/NHDnA on line 16
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:
53.43 ms | 2655 KiB | 4 Q