xref: /PHP-8.1/ext/date/tests/bug78383.phpt (revision 00dd786b)
1--TEST--
2Bug #78383: Casting a DateTime to array no longer returns its properties
3--FILE--
4<?php
5
6var_dump((array) new DateTime('2000-01-01 UTC'));
7var_dump((array) new DateTimeZone('Europe/Berlin'));
8
9?>
10--EXPECT--
11array(3) {
12  ["date"]=>
13  string(26) "2000-01-01 00:00:00.000000"
14  ["timezone_type"]=>
15  int(3)
16  ["timezone"]=>
17  string(3) "UTC"
18}
19array(2) {
20  ["timezone_type"]=>
21  int(3)
22  ["timezone"]=>
23  string(13) "Europe/Berlin"
24}
25