xref: /PHP-8.3/ext/date/tests/bug75232.phpt (revision 2f92957f)
1--TEST--
2Bug #75232: print_r of DateTime creating side-effect
3--INI--
4date.timezone=UTC
5--FILE--
6<?php
7
8$d1 = DateTime::createFromFormat("Ymd\THis\Z", '20170920T091600Z');
9echo $d1->date, "\n";
10
11$d2 = DateTime::createFromFormat("Ymd\THis\Z", '20170920T091600Z');
12print_r($d2);
13echo $d2->date, "\n";
14
15?>
16--EXPECTF--
17Warning: Undefined property: DateTime::$date in %s on line %d
18
19DateTime Object
20(
21    [date] => 2017-09-20 09:16:00.000000
22    [timezone_type] => 3
23    [timezone] => UTC
24)
25
26Warning: Undefined property: DateTime::$date in %s on line %d
27