1--TEST-- 2Test new DateTimeZone(): Too few arguments 3--FILE-- 4<?php 5// Set the default time zone 6date_default_timezone_set("UTC"); 7 8echo "*** Testing DateTimeZone() : error conditions ***\n"; 9 10echo "\n-- Testing new DateTimeZone() with more than expected no. of arguments --\n"; 11$timezone = "GMT"; 12$extra_arg = 99; 13try { 14 new DateTimeZone($timezone, $extra_arg); 15} catch (ArgumentCountError $e) { 16 echo $e::class, ': ', $e->getMessage(), "\n"; 17} 18 19?> 20--EXPECT-- 21*** Testing DateTimeZone() : error conditions *** 22 23-- Testing new DateTimeZone() with more than expected no. of arguments -- 24ArgumentCountError: DateTimeZone::__construct() expects exactly 1 argument, 2 given 25