3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arguments = array('2014-05-06'); $x = call_user_func_array(array('DateTime', '__construct'), $arguments); echo $x->format('d.m.Y');
based on EcJOH
Output for 7.0.0 - 7.2.0
Warning: call_user_func_array() expects parameter 1 to be a valid callback, non-static method DateTime::__construct() cannot be called statically in /in/hmk7X on line 4 Fatal error: Uncaught Error: Call to a member function format() on null in /in/hmk7X:5 Stack trace: #0 {main} thrown in /in/hmk7X on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Warning: call_user_func_array() expects parameter 1 to be a valid callback, non-static method DateTime::__construct() cannot be called statically in /in/hmk7X on line 4 Fatal error: Call to a member function format() on null in /in/hmk7X on line 5
Process exited with code 255.
Output for 5.3.22 - 5.5.35
Warning: call_user_func_array() expects parameter 1 to be a valid callback, non-static method DateTime::__construct() cannot be called statically in /in/hmk7X on line 4 Fatal error: Call to a member function format() on a non-object in /in/hmk7X on line 5
Process exited with code 255.