xref: /PHP-7.1/ext/date/tests/bug62852.phpt (revision 113213f0)
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--EXPECTF--
13Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852.php:%d
14Stack trace:
15#0 [internal function]: DateTime->__wakeup()
16#1 %sbug62852.php(%d): unserialize('O:8:"DateTime":...')
17#2 {main}
18  thrown in %sbug62852.php on line %d
19