xref: /PHP-7.2/ext/session/tests/bug69111.phpt (revision 17ccbeec)
1--TEST--
2Bug #69111 Crash in SessionHandler::read()
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--FILE--
6<?php
7$sh = new SessionHandler;
8session_set_save_handler($sh);
9
10$savePath = ini_get('session.save_path');
11$sessionName = ini_get('session.name');
12
13// session_start(); // Uncommenting this makes it not crash when reading the session (see below), but it will not return any data.
14
15$sh->open($savePath, $sessionName);
16$sh->write("foo", "bar");
17var_dump($sh->read(@$id));
18?>
19--EXPECTF--
20Warning: SessionHandler::open(): Session is not active in %s on line 10
21
22Warning: SessionHandler::write(): Session is not active in %s on line 11
23
24Warning: SessionHandler::read(): Session is not active in %s on line 12
25bool(false)
26