3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = new DateTimeImmutable("now"); class MyDateTime implements \DateTimeInterface { public function diff($datetime2, $absolute = false) { // TODO: Implement diff() method. } public function format($format) { // TODO: Implement format() method. } public function getOffset() { // TODO: Implement getOffset() method. } public function getTimestamp() { // TODO: Implement getTimestamp() method. } public function getTimezone() { // TODO: Implement getTimezone() method. } public function __wakeup() { // TODO: Implement __wakeup() method. } } $d2 = new MyDateTime; var_dump($d->diff($d2));

preferences:
25.14 ms | 404 KiB | 5 Q