3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function pouet(\DateTime $lol) { return $lol->format('c'); } pouet(null);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Fatal error: Uncaught TypeError: Argument 1 passed to pouet() must be an instance of DateTime, null given, called in /in/6iLiV on line 7 and defined in /in/6iLiV:3 Stack trace: #0 /in/6iLiV(7): pouet(NULL) #1 {main} thrown in /in/6iLiV on line 3
Output for Arrow functions
Fatal error: Uncaught TypeError: Argument 1 passed to pouet() must be an instance of DateTime, null given, called in /in/6iLiV on line 7 and defined in /in/6iLiV:3 Stack trace: #0 /in/6iLiV(7): pouet(NULL) #1 {main} thrown in /in/6iLiV on line 3
Output for Object typehint
Fatal error: Uncaught TypeError: Argument 1 passed to pouet() must be an instance of DateTime, null given, called in /in/6iLiV on line 7 and defined in /in/6iLiV:3 Stack trace: #0 /in/6iLiV(7): pouet(NULL) #1 {main} thrown in /in/6iLiV on line 3
Output for Array change keys
Fatal error: Uncaught TypeError: Argument 1 passed to pouet() must be an instance of DateTime, null given, called in /in/6iLiV on line 7 and defined in /in/6iLiV:3 Stack trace: #0 /in/6iLiV(7): pouet(NULL) #1 {main} thrown in /in/6iLiV on line 3
Output for Lexical anon
Catchable fatal error: Argument 1 passed to pouet() must be an instance of DateTime, null given, called in /in/6iLiV on line 7 and defined in /in/6iLiV on line 3

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