1--TEST--
2MessageFormatter::format(): DateTime accepted to format dates and times
3--INI--
4date.timezone=Atlantic/Azores
5--SKIPIF--
6<?php
7if (!extension_loaded('intl'))
8	die('skip intl extension not enabled');
9--FILE--
10<?php
11ini_set("intl.error_level", E_WARNING);
12//ini_set("intl.default_locale", "nl");
13
14$fmt = <<<EOD
15{0,date} {0,time}
16EOD;
17
18$dt = new DateTime("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon"));
19$dti = new DateTimeImmutable("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon"));
20
21$mf = new MessageFormatter('en_US', $fmt);
22
23var_dump($mf->format(array($dt)));
24var_dump($mf->format(array($dti)));
25
26?>
27==DONE==
28--EXPECTF--
29string(%s) "May %d, 2012 %d:%d:42 %s"
30string(%s) "May %d, 2012 %d:%d:42 %s"
31==DONE==
32