1--TEST--
2Test for + character in date format
3--FILE--
4<?php
5$tz = new DateTimeZone("UTC");
6$date = "06/08/04 12:00";
7echo "==\n";
8print_r( date_create_from_format( 'm/d/y', $date , $tz) );
9print_r( date_get_last_errors() );
10echo "==\n";
11print_r( date_create_from_format( 'm/d/y+', $date , $tz)->setTime(0, 0) );
12print_r( date_get_last_errors() );
13echo "==\n";
14print_r( date_create_from_format( '+m/d/y', $date , $tz)->setTime(0, 0) );
15print_r( date_get_last_errors() );
16echo "==\n";
17print_r( date_create_from_format( 'm/d/y++', $date , $tz)->setTime(0, 0) );
18print_r( date_get_last_errors() );
19echo "==\n";
20
21$date = "06/08/04";
22print_r( date_create_from_format( 'm/d/y+', $date , $tz)->setTime(0, 0) );
23print_r( date_get_last_errors() );
24echo "==\n";
25print_r( date_create_from_format( '+m/d/y', $date , $tz)->setTime(0, 0) );
26print_r( date_get_last_errors() );
27echo "==\n";
28
29?>
30--EXPECT--
31==
32Array
33(
34    [warning_count] => 0
35    [warnings] => Array
36        (
37        )
38
39    [error_count] => 1
40    [errors] => Array
41        (
42            [8] => Trailing data
43        )
44
45)
46==
47DateTime Object
48(
49    [date] => 2004-06-08 00:00:00.000000
50    [timezone_type] => 3
51    [timezone] => UTC
52)
53Array
54(
55    [warning_count] => 1
56    [warnings] => Array
57        (
58            [8] => Trailing data
59        )
60
61    [error_count] => 0
62    [errors] => Array
63        (
64        )
65
66)
67==
68DateTime Object
69(
70    [date] => 2004-06-08 00:00:00.000000
71    [timezone_type] => 3
72    [timezone] => UTC
73)
74Array
75(
76    [warning_count] => 1
77    [warnings] => Array
78        (
79            [8] => Trailing data
80        )
81
82    [error_count] => 0
83    [errors] => Array
84        (
85        )
86
87)
88==
89DateTime Object
90(
91    [date] => 2004-06-08 00:00:00.000000
92    [timezone_type] => 3
93    [timezone] => UTC
94)
95Array
96(
97    [warning_count] => 1
98    [warnings] => Array
99        (
100            [8] => Trailing data
101        )
102
103    [error_count] => 0
104    [errors] => Array
105        (
106        )
107
108)
109==
110DateTime Object
111(
112    [date] => 2004-06-08 00:00:00.000000
113    [timezone_type] => 3
114    [timezone] => UTC
115)
116Array
117(
118    [warning_count] => 0
119    [warnings] => Array
120        (
121        )
122
123    [error_count] => 0
124    [errors] => Array
125        (
126        )
127
128)
129==
130DateTime Object
131(
132    [date] => 2004-06-08 00:00:00.000000
133    [timezone_type] => 3
134    [timezone] => UTC
135)
136Array
137(
138    [warning_count] => 0
139    [warnings] => Array
140        (
141        )
142
143    [error_count] => 0
144    [errors] => Array
145        (
146        )
147
148)
149==
150