Skip to content

Commit 15d8c80

Browse files
committed
add test for previous fix
1 parent 3f47368 commit 15d8c80

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

ext/date/tests/bug67118_2.phpt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
Regression introduce in fix for Bug #67118
3+
--INI--
4+
date.timezone=Europe/Paris
5+
--FILE--
6+
<?php
7+
class Foo extends DateTime {
8+
public function __construct($time = null) {
9+
$tz = new DateTimeZone('UTC');
10+
try {
11+
echo "First try\n";
12+
parent::__construct($time, $tz);
13+
return;
14+
} catch (Exception $e) {
15+
echo "Second try\n";
16+
parent::__construct($time.'C', $tz);
17+
}
18+
}
19+
}
20+
$date = '12 Sep 2007 15:49:12 UT';
21+
var_dump(new Foo($date));
22+
?>
23+
Done
24+
--EXPECTF--
25+
First try
26+
Second try
27+
object(Foo)#1 (3) {
28+
["date"]=>
29+
string(26) "2007-09-12 15:49:12.000000"
30+
["timezone_type"]=>
31+
int(3)
32+
["timezone"]=>
33+
string(3) "UTC"
34+
}
35+
Done

0 commit comments

Comments
 (0)