xref: /PHP-8.2/ext/session/tests/gh13680.phpt (revision 6985aff7)
1--TEST--
2GH-13680 (Segfault with session_decode and compilation error)
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--INI--
8session.use_cookies=0
9session.use_strict_mode=0
10session.cache_limiter=
11session.serialize_handler=php_serialize
12session.save_handler=files
13error_reporting=E_ALL
14--FILE--
15<?php
16session_start();
17session_decode('foo');
18class Test extends DateTime {
19    public static function createFromFormat($format, $datetime, $timezone = null): Wrong {}
20}
21?>
22--EXPECTF--
23Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
24
25Fatal error: Could not check compatibility between Test::createFromFormat($format, $datetime, $timezone = null): Wrong and DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, because class Wrong is not available in %s on line %d
26