1--TEST-- 2Test new DateTimeZone() : error conditions 3--FILE-- 4<?php 5/* Prototype : DateTimeZone::__construct ( string $timezone ) 6 * Description: Returns new DateTimeZone object 7 * Source code: ext/date/php_date.c 8 * Alias to functions: 9 */ 10//Set the default time zone 11date_default_timezone_set("GMT"); 12 13echo "*** Testing DateTimeZone() : error conditions ***\n"; 14 15echo "\n-- Testing new DateTimeZone() with more than expected no. of arguments --\n"; 16$timezone = "GMT"; 17$extra_arg = 99; 18var_dump( new DateTimeZone($timezone, $extra_arg) ); 19 20?> 21===DONE=== 22--EXPECTF-- 23*** Testing DateTimeZone() : error conditions *** 24 25-- Testing new DateTimeZone() with more than expected no. of arguments -- 26 27Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 2 given' in %s:%d 28Stack trace: 29#0 %s(%d): DateTimeZone->__construct('GMT', 99) 30#1 {main} 31 thrown in %s on line %d 32