3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { protected $v; public function __construct($v) { $this->v = $v; } } $d = DateTime::createFromFormat("23.12.2015 18:38:00", "d.m.Y H:i:s"); var_dump($d); $a1 = new A(); $a2 = new A(DateTime::createFromFormat("23.12.2015 18:37:00", "d.m.Y H:i:s")); var_dump($a1 > $a2);
based on s2F32
Output for 7.1.0 - 7.2.0
bool(false) Fatal error: Uncaught ArgumentCountError: Too few arguments to function A::__construct(), 0 passed in /in/sbUFe on line 15 and exactly 1 expected in /in/sbUFe:6 Stack trace: #0 /in/sbUFe(15): A->__construct() #1 {main} thrown in /in/sbUFe on line 6
Process exited with code 255.
Output for 5.3.21 - 7.0.20
bool(false) Warning: Missing argument 1 for A::__construct(), called in /in/sbUFe on line 15 and defined in /in/sbUFe on line 6 Notice: Undefined variable: v in /in/sbUFe on line 8 bool(false)