3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $callback = function (\Datetime $now) { echo $now->format('Y'); }; $callback('ghehehehehe');
based on Y5Bvp
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of DateTime, string given, called in /in/iPLFi on line 7 and defined in /in/iPLFi:3 Stack trace: #0 /in/iPLFi(7): {closure}('ghehehehehe') #1 {main} thrown in /in/iPLFi on line 3
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of DateTime, string given, called in /in/iPLFi on line 7 and defined in /in/iPLFi on line 3
Process exited with code 255.