xref: /PHP-8.3/ext/date/tests/bug75002.phpt (revision b7860cd5)
1--TEST--
2Bug #75002 Null Pointer Dereference in timelib_time_clone
3--FILE--
4<?php
5
6class aaa extends DatePeriod {
7    public function __construct() { }
8}
9
10$start=new DateTime( '2012-08-01' );
11
12foreach (new aaa($start) as $y) {
13    $a=$key;
14}
15
16?>
17==DONE==
18--EXPECTF--
19Fatal error: Uncaught DateObjectError: Object of type DatePeriod has not been correctly initialized by calling parent::__construct() in its constructor in %sbug75002.php:%d
20Stack trace:
21#0 {main}
22  thrown in %sbug75002.php on line %d
23