mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

This is effectively removing ZPP tests, enabling warnings, and moving INI settings into the INI PHPT block
25 lines
629 B
PHP
25 lines
629 B
PHP
--TEST--
|
|
MessageFormatter::format(): DateTime accepted to format dates and times
|
|
--EXTENSIONS--
|
|
intl
|
|
--SKIPIF--
|
|
<?php if (version_compare(INTL_ICU_VERSION, '72.1') >= 0) die('skip for ICU < 72.1'); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$fmt = <<<EOD
|
|
{0,date} {0,time}
|
|
EOD;
|
|
|
|
$dt = new DateTime("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon"));
|
|
$dti = new DateTimeImmutable("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon"));
|
|
|
|
$mf = new MessageFormatter('en_US', $fmt);
|
|
|
|
var_dump($mf->format(array($dt)));
|
|
var_dump($mf->format(array($dti)));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
string(%s) "May %d, 2012 %d:%d:42 %s"
|
|
string(%s) "May %d, 2012 %d:%d:42 %s"
|