xref: /PHP-8.2/ext/date/tests/bug62852.phpt (revision 8b2ee538)
1--TEST--
2Bug #62852 (Unserialize invalid DateTime causes crash), variation 1
3--INI--
4date.timezone=GMT
5--FILE--
6<?php
7$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
8
9try {
10    unserialize( $s1 );
11} catch ( Exception $e ) {}
12?>
13--EXPECTF--
14Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852.php:%d
15Stack trace:
16#0 [internal function]: DateTime->__unserialize(Array)
17#1 %sbug62852.php(%d): unserialize('O:8:"DateTime":...')
18#2 {main}
19  thrown in %sbug62852.php on line %d
20