xref: /PHP-7.3/ext/date/tests/bug67253.phpt (revision b746e698)
1--TEST--
2Bug #67253 (timelib_meridian_with_check out-of-bounds read)
3--INI--
4date.timezone=Europe/Berlin
5--FILE--
6<?php
7$z = '';
8var_dump(date_parse_from_format("aHa0", "0=G{$z}9UCNnF"));
9--EXPECT--
10array(12) {
11  ["year"]=>
12  bool(false)
13  ["month"]=>
14  bool(false)
15  ["day"]=>
16  bool(false)
17  ["hour"]=>
18  int(0)
19  ["minute"]=>
20  int(0)
21  ["second"]=>
22  int(0)
23  ["fraction"]=>
24  float(0)
25  ["warning_count"]=>
26  int(0)
27  ["warnings"]=>
28  array(0) {
29  }
30  ["error_count"]=>
31  int(3)
32  ["errors"]=>
33  array(3) {
34    [0]=>
35    string(51) "Meridian can only come after an hour has been found"
36    [1]=>
37    string(29) "A meridian could not be found"
38    [9]=>
39    string(12) "Data missing"
40  }
41  ["is_localtime"]=>
42  bool(false)
43}
44