mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
23 lines
444 B
PHP
23 lines
444 B
PHP
--TEST--
|
|
Inherited DateTimeInterval serialisation with custom properties
|
|
--FILE--
|
|
<?php
|
|
date_default_timezone_set("Europe/London");
|
|
|
|
class MyDateInterval extends DateInterval
|
|
{
|
|
public function __construct(
|
|
string $duration,
|
|
public ?bool $myProperty = null,
|
|
) {
|
|
parent::__construct($duration);
|
|
}
|
|
}
|
|
|
|
$d = new MyDateInterval("P1W2D", myProperty: true);
|
|
$e = unserialize(serialize($d));
|
|
var_dump($e->myProperty);
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|