summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug48476.phpt
blob: 1335025c76b447053381e8e5a408a55169d30b89 (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
--TEST--
Bug #48476 (cloning extended DateTime class without calling parent::__constr crashed PHP)
--FILE--
<?php
class MyDateTime extends DateTime {
	public function __construct() { }
}
class MyDateTimeZone extends DateTimeZone {
	public function __construct() { }
}

$o = new MyDateTime;
var_dump($o->format("d"));
$x = clone $o;

var_dump($x->format("d"));

clone $o;


var_dump(timezone_location_get(clone new MyDateTimezone));
?>
--EXPECTF--
Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %sbug48476.php on line 10
bool(false)

Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %sbug48476.php on line 13
bool(false)

Warning: timezone_location_get(): The DateTimeZone object has not been correctly initialized by its constructor in %sbug48476.php on line 18
bool(false)