summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug54316.phpt
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/date/tests/bug54316.phpt
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/date/tests/bug54316.phpt')
-rw-r--r--ext/date/tests/bug54316.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/date/tests/bug54316.phpt b/ext/date/tests/bug54316.phpt
new file mode 100644
index 0000000..a02288c
--- /dev/null
+++ b/ext/date/tests/bug54316.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #54316 (DateTime::createFromFormat does not handle trailing '|' correctly)
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+$dt = DateTime::createFromFormat('Y-m-d|', '2011-02-02');
+var_dump($dt);
+
+$dt = DateTime::createFromFormat('Y-m-d!', '2011-02-02');
+var_dump($dt);
+--EXPECT--
+object(DateTime)#1 (3) {
+ ["date"]=>
+ string(19) "2011-02-02 00:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+}
+object(DateTime)#2 (3) {
+ ["date"]=>
+ string(19) "1970-01-01 00:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+}