1--TEST--
2DateInterval uninitialised exceptions
3--INI--
4date.timezone=Europe/London
5--FILE--
6<?php
7class MyDateInterval extends DateInterval
8{
9	function __construct()
10	{
11	}
12}
13
14function check(callable $c)
15{
16	try {
17		var_dump($c());
18	} catch (\DateObjectError $e) {
19		echo $e::class, ': ', $e->getMessage(), "\n";
20	}
21}
22
23$mdi = new MyDateInterval();
24
25check(fn() => serialize($mdi));
26check(fn() => $mdi->format("Y-m-d"));
27?>
28--EXPECTF--
29DateObjectError: Object of type MyDateInterval (inheriting DateInterval) has not been correctly initialized by calling parent::__construct() in its constructor
30DateObjectError: Object of type MyDateInterval (inheriting DateInterval) has not been correctly initialized by calling parent::__construct() in its constructor
31