1--TEST-- 2Test date_create() function : basic functionality 3--FILE-- 4<?php 5//Set the default time zone 6date_default_timezone_set("Europe/London"); 7 8echo "*** Testing checkdate() : basic functionality ***\n"; 9 10echo "-- The following are all valid dates --\n"; 11var_dump( checkdate(1, 1, 2009) ); 12var_dump( checkdate(12, 31, 2009) ); 13var_dump( checkdate(7, 2, 1963) ); 14var_dump( checkdate(5, 31, 2009) ); 15var_dump( checkdate(2, 28, 2009) ); // non-leap year 16var_dump( checkdate(2, 29, 2008) ); // leap year 17var_dump( checkdate(7, 2, 1) ); // min year 18var_dump( checkdate(7, 2, 32767) ); // max year 19 20echo "-- The following are all invalid dates --\n"; 21var_dump( checkdate(13, 1, 2009) ); 22var_dump( checkdate(2, 31, 2009) ); 23var_dump( checkdate(1, 32, 2009) ); 24var_dump( checkdate(2, 29, 2009) ); // non-leap year 25var_dump( checkdate(7, 2, 32768) ); // >max year 26var_dump( checkdate(7, 2, 0) ); // <min year 27 28?> 29--EXPECT-- 30*** Testing checkdate() : basic functionality *** 31-- The following are all valid dates -- 32bool(true) 33bool(true) 34bool(true) 35bool(true) 36bool(true) 37bool(true) 38bool(true) 39bool(true) 40-- The following are all invalid dates -- 41bool(false) 42bool(false) 43bool(false) 44bool(false) 45bool(false) 46bool(false) 47