3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Embrace; use DateTime; class Embrace { public function testPass(DateTime $date) { return $date->format('Y-m-d'); } } $obj = new Embrace(); $now = new DateTime(); $obj->testPass($now->format('W'));
Output for 7.0.5, 7.0.14 - 7.1.0
Fatal error: Uncaught TypeError: Argument 1 passed to Embrace\Embrace::testPass() must be an instance of DateTime, string given, called in /in/j7FEQ on line 15 and defined in /in/j7FEQ:7 Stack trace: #0 /in/j7FEQ(15): Embrace\Embrace->testPass('13') #1 {main} thrown in /in/j7FEQ on line 7
Process exited with code 255.
Output for 7.0.6
Fatal error: Uncaught TypeError: Argument 1 passed to Embrace\Embrace::testPass() must be an instance of DateTime, string given, called in /in/j7FEQ on line 15 and defined in /in/j7FEQ:7 Stack trace: #0 /in/j7FEQ(15): Embrace\Embrace->testPass('18') #1 {main} thrown in /in/j7FEQ on line 7
Process exited with code 255.
Output for 7.0.4
Fatal error: Uncaught TypeError: Argument 1 passed to Embrace\Embrace::testPass() must be an instance of DateTime, string given, called in /in/j7FEQ on line 15 and defined in /in/j7FEQ:7 Stack trace: #0 /in/j7FEQ(15): Embrace\Embrace->testPass('10') #1 {main} thrown in /in/j7FEQ on line 7
Process exited with code 255.
Output for 7.0.3
Fatal error: Uncaught TypeError: Argument 1 passed to Embrace\Embrace::testPass() must be an instance of DateTime, string given, called in /in/j7FEQ on line 15 and defined in /in/j7FEQ:7 Stack trace: #0 /in/j7FEQ(15): Embrace\Embrace->testPass('11') #1 {main} thrown in /in/j7FEQ on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.2
Fatal error: Uncaught TypeError: Argument 1 passed to Embrace\Embrace::testPass() must be an instance of DateTime, string given, called in /in/j7FEQ on line 15 and defined in /in/j7FEQ:7 Stack trace: #0 /in/j7FEQ(15): Embrace\Embrace->testPass('12') #1 {main} thrown in /in/j7FEQ on line 7
Process exited with code 255.
Output for 5.3.7 - 5.6.28
Catchable fatal error: Argument 1 passed to Embrace\Embrace::testPass() must be an instance of DateTime, string given, called in /in/j7FEQ on line 15 and defined in /in/j7FEQ on line 7
Process exited with code 255.