<?php class Impl1 { public function date($a = 'Y-m-d') { return date($a); } } class Impl2 extends Impl1 { public function date($a = 'm.d.Y') { return parent::date($a); } } function foo(Impl1 $impl) { $date = $impl->date(); // assuming default format is 'Y-m-d' var_dump(DateTime::createFromFormat('Y-m-d', $date)); } foo(new Impl2);
You have javascript disabled. You will not be able to edit any code.