mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
48 lines
879 B
PHP
48 lines
879 B
PHP
--TEST--
|
|
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
|
|
--INI--
|
|
session.save_path=
|
|
session.name=PHPSESSID
|
|
session.save_handler=files
|
|
--EXTENSIONS--
|
|
session
|
|
--FILE--
|
|
<?php
|
|
|
|
ob_start();
|
|
|
|
class MySessionHandler implements SessionHandlerInterface {
|
|
function open($save_path, $session_name): bool {
|
|
return true;
|
|
}
|
|
|
|
function close(): bool {
|
|
die("close: goodbye cruel world\n");
|
|
}
|
|
|
|
function read($id): string|false {
|
|
return '';
|
|
}
|
|
|
|
function write($id, $session_data): bool {
|
|
die("write: goodbye cruel world\n");
|
|
}
|
|
|
|
function destroy($id): bool {
|
|
return true;
|
|
}
|
|
|
|
function gc($maxlifetime): int {
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
session_set_save_handler(new MySessionHandler());
|
|
session_start();
|
|
session_write_close();
|
|
echo "um, hi\n";
|
|
|
|
?>
|
|
--EXPECT--
|
|
write: goodbye cruel world
|