3v4l.org

run code in 300+ PHP versions simultaneously
<?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 call_user_func_array([$this->dt, $methodName], $args); } } } $a = new myCustomThing('now'); echo $a->format('c');

preferences:
64.49 ms | 402 KiB | 5 Q