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 $this->dt->$methodName($args); } } } $a = new myCustomThing('now'); echo $a->format('c');

preferences:
54.4 ms | 402 KiB | 5 Q