1--TEST-- 2IntlCalendar::fromDateTime(): errors 3--EXTENSIONS-- 4intl 5--FILE-- 6<?php 7ini_set("intl.error_level", E_WARNING); 8ini_set("intl.default_locale", "nl"); 9date_default_timezone_set('Europe/Lisbon'); 10 11try { 12 IntlCalendar::fromDateTime("foobar"); 13} catch (Exception $e) { 14 echo "threw exception, OK"; 15} 16class A extends DateTime { 17function __construct() {} 18} 19 20var_dump(IntlCalendar::fromDateTime(new A)); 21 22$date = new DateTime('2012-01-01 00:00:00 +24:00'); 23var_dump(IntlCalendar::fromDateTime($date)); 24 25$date = new DateTime('2012-01-01 00:00:00 WEST'); 26var_dump(IntlCalendar::fromDateTime($date)); 27?> 28--EXPECTF-- 29threw exception, OK 30Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: DateTime object is unconstructed in %s on line %d 31NULL 32 33Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: object has an time zone offset that's too large in %s on line %d 34NULL 35 36Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d 37NULL 38