php / php-src

The PHP Interpreter
https://www.php.net
Other
38.22k stars 7.75k forks source link

Assertion failure in ext/date/php_date.c #16037

Closed YuanchengJiang closed 4 weeks ago

YuanchengJiang commented 1 month ago

Description

The following code:

<?php
$d = new DateInterval('P2Y4DT6H8M');
$fusion = $d;
$u = [[]];
$fusion->__unserialize($u);

Resulted in this output:

/php-src/ext/date/php_date.c:4841: void restore_custom_dateinterval_properties(zval *, HashTable *): Assertion `!(((__ht)->u.flags & (1<<2)) != 0)' failed.
Aborted (core dumped)

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

DanielEScherzer commented 1 month ago

Minimal reproduction:

<?php
new DateInterval('P1Y')->__unserialize([[]]);