summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug50392.phpt
blob: 8d10923e0394dc198f71b3ad499944f1a2805d8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--TEST--
Bug #50392 date_create_from_format enforces 6 digits for 'u' format character
--FILE--
<?php
date_default_timezone_set('Europe/Bratislava');

$base = '2009-03-01 18:00:00';

for ($i = 0; $i < 8; $i++) {
	var_dump(date_create_from_format('Y-m-d H:i:s.u', $base . '.' . str_repeat('1', $i)));
}
?>
--EXPECT--
bool(false)
object(DateTime)#2 (3) {
  ["date"]=>
  string(19) "2009-03-01 18:00:00"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(17) "Europe/Bratislava"
}
object(DateTime)#2 (3) {
  ["date"]=>
  string(19) "2009-03-01 18:00:00"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(17) "Europe/Bratislava"
}
object(DateTime)#2 (3) {
  ["date"]=>
  string(19) "2009-03-01 18:00:00"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(17) "Europe/Bratislava"
}
object(DateTime)#2 (3) {
  ["date"]=>
  string(19) "2009-03-01 18:00:00"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(17) "Europe/Bratislava"
}
object(DateTime)#2 (3) {
  ["date"]=>
  string(19) "2009-03-01 18:00:00"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(17) "Europe/Bratislava"
}
object(DateTime)#2 (3) {
  ["date"]=>
  string(19) "2009-03-01 18:00:00"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(17) "Europe/Bratislava"
}
bool(false)