1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/date/tests/bug68669.phpt
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00

27 lines
660 B
PHP

--TEST--
DateTime::createFromFormat() does not allow NULL $timezone
--FILE--
<?php
date_default_timezone_set('America/Los_Angeles');
var_dump(DateTime::createFromFormat('Y/m/d H:i:s', '1995/06/08 12:34:56', null));
var_dump(DateTimeImmutable::createFromFormat('Y/m/d H:i:s', '1995/06/08 12:34:56', null));
?>
--EXPECT--
object(DateTime)#1 (3) {
["date"]=>
string(26) "1995-06-08 12:34:56.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(19) "America/Los_Angeles"
}
object(DateTimeImmutable)#1 (3) {
["date"]=>
string(26) "1995-06-08 12:34:56.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(19) "America/Los_Angeles"
}