[php-src] Issue #7939: Cannot serialize IntlTimeZone objects
| From: | drjayvee | Date: | Thu, 13 Jan 2022 10:29:12 +0000 |
| Subject: | [php-src] Issue #7939: Cannot serialize IntlTimeZone objects | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238998@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7939
Author: drjayvee
### Description
The following code:
```php
<?php
$tz = IntlTimeZone::createTimeZone('Europe/Amsterdam');
$tz = unserialize(serialize($tz));
var_export($tz->getId());
```
Resulted in this output:
```
false
```
But I expected this output instead:
```
'Europe/Amsterdam'
```
It looks like the implementation of
__serialize is broken, as the string doesn't
contain any object data:
```php
echo serialize(IntlTimeZone::createTimeZone('Europe/Amsterdam'));
// outputs O:12:"IntlTimeZone":0:{}
```
### PHP Version
PHP 7.4.27 (cli) (built: Dec 21 2021 21:31:45) ( NTS )
### Operating System
_No response_