1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/ext/session/tests/bug73100.phpt
T
Calvin Buckley 84d6cb8cf0 Unify headers already sent/session already started error handler (#16451)
* Unify headers already sent errors

Now whenever we need to check where headers were already sent in
ext/session, we call a single location that prints where, keeping it
consistent output wise.

* Unify session aready started errors

Similar to the one for headers.

* Also change session active checks too

This usually go hand in hand with the headers already sent checks, but
is in a separate commit because of the amount of tests it changes.
2024-10-17 13:13:56 -03:00

29 lines
646 B
PHP

--TEST--
Bug #73100 (session_destroy null dereference in ps_files_path_create)
--EXTENSIONS--
session
--INI--
session.save_path=
session.save_handler=files
--FILE--
<?php
ob_start();
var_dump(session_start());
session_module_name("user");
var_dump(session_destroy());
try {
session_module_name("user");
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
===DONE===
--EXPECTF--
bool(true)
Warning: session_module_name(): Session save handler module cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(true)
session_module_name(): Argument #1 ($module) cannot be "user"
===DONE===