xref: /PHP-7.4/ext/date/tests/bug55397.phpt (revision b8bb4d77)
1--TEST--
2Bug #55397 (comparison of incomplete DateTime causes SIGSEGV)
3--FILE--
4<?php
5date_default_timezone_set('Europe/Prague');
6var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime);
7?>
8--EXPECTF--
9Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug55397.php:%d
10Stack trace:
11#0 [internal function]: DateTime->__wakeup()
12#1 %sbug55397.php(%d): unserialize('O:8:"DateTime":...')
13#2 {main}
14  thrown in %sbug55397.php on line %d
15