3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExtendsDateTime extends DateTime { public function __construct($datetime, $tz) { var_dump($datetime); } public static function createFromFormat($format, $datetime, $timezone = null) { return parent::createFromFormat($format, $datetime); } } $date = ExtendsDateTime::createFromFormat('Y-m-d', '2014-02-14'); var_dump($date instanceof ExtendsDateTime);