Skip to content

Commit 53b5105

Browse files
committed
Merge branch 'PHP-8.0'
* Fix session cleanup * Fix the return type of SessionHandler::gc()
2 parents 010d6a4 + 6fb08f4 commit 53b5105

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

ext/session/session.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function write(string $id, string $data);
8080
/** @return bool */
8181
public function destroy(string $id);
8282

83-
/** @return int|bool */
83+
/** @return int|false */
8484
public function gc(int $max_lifetime);
8585
}
8686

@@ -116,7 +116,7 @@ public function write(string $id, string $data) {}
116116
/** @return bool */
117117
public function destroy(string $id) {}
118118

119-
/** @return int|bool */
119+
/** @return int|false */
120120
public function gc(int $max_lifetime) {}
121121

122122
/** @return string */

ext/session/session_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9da20561a8281bb762b035f1e2ef8b3c866dda35 */
2+
* Stub hash: f7f6a3d0357da86516b42fcd5cc2e618aa0049b8 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_name, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")

ext/session/tests/session_set_save_handler_closures.phpt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ var_dump(session_module_name(FALSE));
1919
var_dump(session_module_name("blah"));
2020
var_dump(session_module_name("foo"));
2121

22-
$path = __DIR__;
22+
$path = __DIR__ . '/session_set_save_handler_closures';
23+
@mkdir($path);
2324
session_save_path($path);
2425
session_set_save_handler($open_closure, $close_closure, $read_closure, $write_closure, $destroy_closure, $gc_closure);
2526

@@ -41,7 +42,12 @@ $_SESSION['Bar'] = 'Foo';
4142
var_dump($_SESSION);
4243
session_write_close();
4344

45+
echo "Cleanup\n";
46+
session_start();
47+
session_destroy();
48+
4449
ob_end_flush();
50+
@rmdir($path);
4551
?>
4652
--EXPECTF--
4753
*** Testing session_set_save_handler() : using closures as callbacks ***
@@ -90,3 +96,8 @@ array(4) {
9096
}
9197
Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";]
9298
Close [%s,PHPSESSID]
99+
Cleanup
100+
Open [%s,PHPSESSID]
101+
Read [%s,%s]
102+
Destroy [%s,%s]
103+
Close [%s,PHPSESSID]

0 commit comments

Comments
 (0)