3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: Embrace\Embrace::testPass(): Argument #1 ($date) must be of type 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.5, 7.0.14 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 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.

preferences:
201.77 ms | 402 KiB | 283 Q