mirror of
https://github.com/php/php-src.git
synced 2024-10-04 00:06:16 +00:00
c51f77fe83
Request #25630 Request #43980 Request #54383 Bug #65359 and many others similar to these that are closed as "wont fix" or "not a bug". Current serializers have limitations due to register_globals support that are no longer supported. Changing existing serializer may cause compatibility issue. Therefore, new handler is needed to remove needless limitations. php_serialize does not have special characters and allow numerical index in $_SESSION. $_SESSION can be used as ordinary array.
25 lines
500 B
PHP
25 lines
500 B
PHP
--TEST--
|
|
Test session_encode() function : Numeric key raise error. bug65359
|
|
--SKIPIF--
|
|
<?php include('skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
ob_start();
|
|
|
|
ini_set('session.serialize_handler', 'php_serialize');
|
|
var_dump(session_start());
|
|
$_SESSION[-3] = 'foo';
|
|
$_SESSION[3] = 'bar';
|
|
$_SESSION['var'] = 123;
|
|
var_dump(session_encode());
|
|
session_write_close();
|
|
|
|
// Should finish without errors
|
|
echo 'Done'.PHP_EOL;
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
string(51) "a:3:{i:-3;s:3:"foo";i:3;s:3:"bar";s:3:"var";i:123;}"
|
|
Done
|
|
|