xref: /PHP-8.0/ext/date/tests/bug64975.phpt (revision 4aeff60f)
1--TEST--
2Bug #64975: Wrong error parsing when AM/PM not at the end
3--INI--
4date.timezone=UTC
5--FILE--
6<?php
7$date = DateTime::createFromFormat('d M Y A h:i', '11 Mar 2013 PM 3:34');
8var_dump($date, DateTime::getLastErrors());
9?>
10--EXPECT--
11bool(false)
12array(4) {
13  ["warning_count"]=>
14  int(0)
15  ["warnings"]=>
16  array(0) {
17  }
18  ["error_count"]=>
19  int(1)
20  ["errors"]=>
21  array(1) {
22    [12]=>
23    string(51) "Meridian can only come after an hour has been found"
24  }
25}
26