xref: /PHP-8.0/ext/session/tests/bug73100.phpt (revision 82e14ff8)
1--TEST--
2Bug #73100 (session_destroy null dereference in ps_files_path_create)
3--SKIPIF--
4<?php
5if (!extension_loaded('session')) die('skip session extension not available');
6?>
7--INI--
8session.save_path=
9session.save_handler=files
10--FILE--
11<?php
12ob_start();
13var_dump(session_start());
14session_module_name("user");
15var_dump(session_destroy());
16
17try {
18    session_module_name("user");
19} catch (\ValueError $e) {
20    echo $e->getMessage() . \PHP_EOL;
21}
22?>
23===DONE===
24--EXPECTF--
25bool(true)
26
27Warning: session_module_name(): Session save handler module cannot be changed when a session is active in %s on line %d
28bool(true)
29session_module_name(): Argument #1 ($module) cannot be "user"
30===DONE===
31