[php-src] Issue #8872: Parser DateTime vs DateTimeZone
| From: | hormus | Date: | Sun, 26 Jun 2022 01:15:36 +0000 |
| Subject: | [php-src] Issue #8872: Parser DateTime vs DateTimeZone | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241809@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8872
Author: hormus
### Description
The following code:
```php
<?php
$date = new DateTime('2020-10-30 02:00:00', new
DateTimeZone('Europe/Amsterdam'));
$date2 = new DateTime('2020-10-30 02:00:00 Europe/Amsterdam');
var_dump($date->format('U') == $date2->format('U'));
```
Resulted in this output from php 8.1.7:
```
false
```
But I expected this output instead:
```
true
```
### PHP Version
php 8.1.7
### Operating System
Irrelevant