1--TEST-- 2Test DateTime class inheritance : with user space fromat() method 3--FILE-- 4<?php 5//Set the default time zone 6date_default_timezone_set("Europe/London"); 7 8echo "*** Testing new DateTime() : with user format() method ***\n"; 9 10class DateTimeExt extends DateTime 11{ 12 public function format($format = "F j, Y, g:i:s a") 13 { 14 return parent::format($format); 15 } 16} 17 18$d = new DateTimeExt("1967-05-01 22:30:41"); 19echo $d->format() . "\n"; 20 21?> 22===DONE=== 23--EXPECTF-- 24*** Testing new DateTime() : with user format() method *** 25May 1, 1967, 10:30:41 pm 26===DONE=== 27