3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class myCustomThing { private $dt; public function __construct($date=NULL) { $this->dt = new DateTime($date); } public function __call($methodName, $args) { if (! method_exists($this, $methodName)) { return $this->dt->$methodName($args); } } } $a = new myCustomThing('now'); echo $a->format('c');
Output for 5.6.0 - 7.3.0alpha1
Warning: DateTime::format() expects parameter 1 to be string, array given in /in/gfIIa on line 13