1--TEST--
2Test session_create_id() function : invalid prefix
3--INI--
4session.save_handler=files
5session.sid_length=32
6--EXTENSIONS--
7session
8--SKIPIF--
9<?php include('skipif.inc'); ?>
10--FILE--
11<?php
12
13var_dump(session_create_id('_'));
14var_dump(session_create_id('%'));
15
16try {
17    var_dump(session_create_id('ABTgdPs68S3M4HMaqKwj33TzqLMv5PHpWQxJbfpeogEhrJRY7o9f33pKLCmhf0tXCtoBkIu0yxXYCSHfJhPd2miPUW4MIpd91dnEiOwWDfaBnfdJZOwgvgmYLSfDGaebqmnCAoyuzlcq2j59nNRhccgJIkr9ytY3RwFTTXszpcjpx6mlJuG9GksKAhPsnnaEwSEb0eFyqvn80gYI2roKSjaFSmJxg0xgXuCF4csMo8DxiSvovho5QTKx5u7h8VyQL'));
18} catch (Throwable $e) {
19    echo $e::class . ': ' . $e->getMessage() . "\n";
20}
21
22try {
23    var_dump(session_create_id("AB\0CD"));
24} catch (Throwable $e) {
25    echo $e::class . ': ' . $e->getMessage() . "\n";
26}
27
28?>
29Done
30--EXPECTF--
31Warning: session_create_id(): Prefix cannot contain special characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in %s on line %d
32bool(false)
33
34Warning: session_create_id(): Prefix cannot contain special characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in %s on line %d
35bool(false)
36ValueError: session_create_id(): Argument #1 ($prefix) cannot be longer than 256 characters
37ValueError: session_create_id(): Argument #1 ($prefix) must not contain any null bytes
38Done
39