1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Files
archived-php-src/ext/date/tests/bug67118.phpt
T
Stanislav Malyshev ac6c86b7dc fix test
2014-06-10 14:25:49 -07:00

27 lines
606 B
PHP

--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 null in %sbug67118.php on line %d