xref: /PHP-8.2/ext/session/tests/bug31454.phpt (revision b5a14e6c)
1--TEST--
2Bug #31454 (session_set_save_handler crashes PHP when supplied non-existent object ref)
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--FILE--
8<?php
9
10try {
11    session_set_save_handler(
12        array(&$arf, 'open'),
13        array(&$arf, 'close'),
14        array(&$arf, 'read'),
15        array(&$arf, 'write'),
16        array(&$arf, 'destroy'),
17        array(&$arf, 'gc')
18    );
19} catch (TypeError $exception) {
20    echo $exception->getMessage() . "\n";
21}
22
23echo "Done\n";
24?>
25--EXPECT--
26session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "Array" not found or invalid function name
27Done
28