summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug67118.phpt
blob: 2aa8c1d8285451a3b85faf5523f6ea7d6913ddb2 (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
--TEST--
Bug #67118 crashes in DateTime when this used after failed __construct
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
class mydt extends datetime
{
	public function __construct($time = 'now', $tz = NULL, $format = NULL)
	{
		if (!empty($tz) && !is_object($tz)) {
			$tz = new DateTimeZone($tz);
		}
		try {
			@parent::__construct($time, $tz);
		} catch (Exception $e) {
			echo "Bad date" . $this->format("Y") . "\n";
		}
	}

};

new mydt("Funktionsansvarig rÄdgivning och juridik", "UTC");
?>
--EXPECTF--
Fatal error: Call to a member function format() on a non-object in %sbug67118.php on line %d