Commit 00f90287a1c for php.net

commit 00f90287a1c06e6254375dae03a94f8d8a87ed9a
Author: Gina Peter Banyard <girgias@php.net>
Date:   Sat Aug 15 14:04:07 2026 +0100

    session: add create_sid and validateId methods to some tests

diff --git a/ext/session/tests/gh12504.phpt b/ext/session/tests/gh12504.phpt
index eb19424eb50..8b1b3ad9463 100644
--- a/ext/session/tests/gh12504.phpt
+++ b/ext/session/tests/gh12504.phpt
@@ -34,6 +34,15 @@ public function write($id, $data): bool
 		echo $data . PHP_EOL;
 		return true;
 	}
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 register_shutdown_function(function() {
diff --git a/ext/session/tests/session_module_name_variation2.phpt b/ext/session/tests/session_module_name_variation2.phpt
index 0e78ab86621..feb9484f281 100644
--- a/ext/session/tests/session_module_name_variation2.phpt
+++ b/ext/session/tests/session_module_name_variation2.phpt
@@ -18,6 +18,14 @@ public function read($id): string|false { return false; }
     public function write($id, $session_data): bool { return false; }
     public function destroy($id): bool { return false; }
     public function gc($maxlifetime): int { return 1; }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 var_dump(session_module_name("files"));
diff --git a/ext/session/tests/session_module_name_variation3.phpt b/ext/session/tests/session_module_name_variation3.phpt
index 2a055e8c04b..0b621c3a16c 100644
--- a/ext/session/tests/session_module_name_variation3.phpt
+++ b/ext/session/tests/session_module_name_variation3.phpt
@@ -24,6 +24,14 @@ public function read($id): string|false { return ''; }
     public function write($id, $session_data): bool { return true; }
     public function destroy($id): bool { return true; }
     public function gc($maxlifetime): int { return 1; }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 var_dump(session_module_name("files"));
diff --git a/ext/session/tests/user_session_module/basic_set_save_handler_test.phpt b/ext/session/tests/user_session_module/basic_set_save_handler_test.phpt
index d1b41dc4c50..63b6e8a1c44 100644
--- a/ext/session/tests/user_session_module/basic_set_save_handler_test.phpt
+++ b/ext/session/tests/user_session_module/basic_set_save_handler_test.phpt
@@ -44,6 +44,14 @@ function destroy($key): bool
     }

     function gc($max_lifetime): int { return 1; }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 $hnd = new handler;
diff --git a/ext/session/tests/user_session_module/basic_set_save_handler_test02.phpt b/ext/session/tests/user_session_module/basic_set_save_handler_test02.phpt
index ec2858fe2d8..61f7e540574 100644
--- a/ext/session/tests/user_session_module/basic_set_save_handler_test02.phpt
+++ b/ext/session/tests/user_session_module/basic_set_save_handler_test02.phpt
@@ -45,6 +45,14 @@ function destroy($key): bool
     }

     function gc($max_lifetime): int { return 1; }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 $hnd = new handler;
diff --git a/ext/session/tests/user_session_module/bug32330.phpt b/ext/session/tests/user_session_module/bug32330.phpt
index e14161c1e7b..712f2a4f972 100644
--- a/ext/session/tests/user_session_module/bug32330.phpt
+++ b/ext/session/tests/user_session_module/bug32330.phpt
@@ -49,6 +49,14 @@ function gc($maxlifetime): int
         echo "gc: maxlifetime = {$maxlifetime}\n";
         return 1;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 session_set_save_handler(new MySessionHandler());
diff --git a/ext/session/tests/user_session_module/bug60634.phpt b/ext/session/tests/user_session_module/bug60634.phpt
index 786c3358e78..4035263fac7 100644
--- a/ext/session/tests/user_session_module/bug60634.phpt
+++ b/ext/session/tests/user_session_module/bug60634.phpt
@@ -35,6 +35,14 @@ function destroy($id): bool {
     function gc($maxlifetime): int {
         return 1;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 session_set_save_handler(new MySessionHandler());
diff --git a/ext/session/tests/user_session_module/bug60634_error_1.phpt b/ext/session/tests/user_session_module/bug60634_error_1.phpt
index 98e4d371dd8..8c141804df3 100644
--- a/ext/session/tests/user_session_module/bug60634_error_1.phpt
+++ b/ext/session/tests/user_session_module/bug60634_error_1.phpt
@@ -37,6 +37,14 @@ function destroy($id): bool {
     function gc($maxlifetime): int {
         return 1;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }
 session_set_save_handler(new MySessionHandler());
 session_start();
diff --git a/ext/session/tests/user_session_module/bug60634_error_2.phpt b/ext/session/tests/user_session_module/bug60634_error_2.phpt
index 0de1f0b70b6..7aea0f6a35b 100644
--- a/ext/session/tests/user_session_module/bug60634_error_2.phpt
+++ b/ext/session/tests/user_session_module/bug60634_error_2.phpt
@@ -37,6 +37,14 @@ function destroy($id): bool {
     function gc($maxlifetime): int {
         return true;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 session_set_save_handler(new MySessionHandler());
diff --git a/ext/session/tests/user_session_module/bug60634_error_5.phpt b/ext/session/tests/user_session_module/bug60634_error_5.phpt
index 4103b43b982..0e2be520209 100644
--- a/ext/session/tests/user_session_module/bug60634_error_5.phpt
+++ b/ext/session/tests/user_session_module/bug60634_error_5.phpt
@@ -36,6 +36,14 @@ function destroy($id): bool {
     function gc($maxlifetime): int {
         return 1;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 session_set_save_handler(new MySessionHandler());
diff --git a/ext/session/tests/user_session_module/bug61728.phpt b/ext/session/tests/user_session_module/bug61728.phpt
index 152cf9f42be..647502712e2 100644
--- a/ext/session/tests/user_session_module/bug61728.phpt
+++ b/ext/session/tests/user_session_module/bug61728.phpt
@@ -35,6 +35,14 @@ function destroy ($id): bool {
     function gc ($maxlifetime): int {
         return 1;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 session_set_save_handler(new MySessionHandler());
diff --git a/ext/session/tests/user_session_module/bug78624.phpt b/ext/session/tests/user_session_module/bug78624.phpt
index 103fc97a6fe..75a6650d94d 100644
--- a/ext/session/tests/user_session_module/bug78624.phpt
+++ b/ext/session/tests/user_session_module/bug78624.phpt
@@ -38,6 +38,14 @@ public function gc($ts): int|false {
         echo 'Garbage collect', "\n";
         return 1;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 $handler = new MySession;
diff --git a/ext/session/tests/user_session_module/bug80889.phpt b/ext/session/tests/user_session_module/bug80889.phpt
index c388a67a932..c8da6d33fe1 100644
--- a/ext/session/tests/user_session_module/bug80889.phpt
+++ b/ext/session/tests/user_session_module/bug80889.phpt
@@ -25,6 +25,14 @@ public function destroy($id): bool {
     public function gc($maxlifetime): int|false {
         return true;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 $initHandler = ini_get('session.save_handler');
diff --git a/ext/session/tests/user_session_module/session_regenerate_id_destroy_fails.phpt b/ext/session/tests/user_session_module/session_regenerate_id_destroy_fails.phpt
index 5ad41aeeacf..e2e346aa15e 100644
--- a/ext/session/tests/user_session_module/session_regenerate_id_destroy_fails.phpt
+++ b/ext/session/tests/user_session_module/session_regenerate_id_destroy_fails.phpt
@@ -31,6 +31,14 @@ function destroy($id): bool {
     function gc($maxlifetime): int|false {
         return 0;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 session_set_save_handler(new FailingDestroyHandler());
diff --git a/ext/session/tests/user_session_module/session_regenerate_id_write_fails.phpt b/ext/session/tests/user_session_module/session_regenerate_id_write_fails.phpt
index 1f5c3f84099..083ec92f385 100644
--- a/ext/session/tests/user_session_module/session_regenerate_id_write_fails.phpt
+++ b/ext/session/tests/user_session_module/session_regenerate_id_write_fails.phpt
@@ -31,6 +31,14 @@ function destroy($id): bool {
     function gc($maxlifetime): int|false {
         return 0;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 session_set_save_handler(new FailingWriteHandler());
diff --git a/ext/session/tests/user_session_module/session_set_save_handler_class_002.phpt b/ext/session/tests/user_session_module/session_set_save_handler_class_002.phpt
index bad19815d08..92d176ddcf3 100644
--- a/ext/session/tests/user_session_module/session_set_save_handler_class_002.phpt
+++ b/ext/session/tests/user_session_module/session_set_save_handler_class_002.phpt
@@ -48,6 +48,14 @@ public function gc($maxlifetime): int|false {
         }
         return true;
     }
+
+    private int $id = 0;
+	public function create_sid(): string {
+	    return ++$this->id;
+	}
+	public function validateId(string $id): bool {
+	    return $id > 0 && $id <= $this->id;
+	}
 }

 $handler = new MySession2;
diff --git a/ext/session/tests/user_session_module/session_set_save_handler_class_018.phpt b/ext/session/tests/user_session_module/session_set_save_handler_class_018.phpt
index 49aa0cf8fd7..c1d15a2a460 100644
--- a/ext/session/tests/user_session_module/session_set_save_handler_class_018.phpt
+++ b/ext/session/tests/user_session_module/session_set_save_handler_class_018.phpt
@@ -52,7 +52,7 @@ public function create_sid(): string {
         return pathinfo(__FILE__)['filename'];
     }

-    public function validate_sid($id): bool {
+    public function validateId($id): bool {
         return pathinfo(__FILE__)['filename']===$id;
     }
 }
diff --git a/ext/session/tests/user_session_module/session_set_save_handler_sid_002.phpt b/ext/session/tests/user_session_module/session_set_save_handler_sid_002.phpt
index c9a10de4e44..4a940fe8768 100644
--- a/ext/session/tests/user_session_module/session_set_save_handler_sid_002.phpt
+++ b/ext/session/tests/user_session_module/session_set_save_handler_sid_002.phpt
@@ -48,6 +48,10 @@ public function gc($maxlifetime): int|false {
     public function create_sid() {
         return false;
     }
+
+	public function validateId(string $id): bool {
+	    return true;
+	}
 }

 session_set_save_handler(new MySession2());