|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-07 19:07 UTC] johannes@php.net
[2005-10-08 01:00 UTC] pavel_bogdanovic at yahoo dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
Description: ------------ Situation: The session array key is the same like the var name. After serialize() the argument is also serialized. Reproduce code: --------------- <?php session_start(); $a[] = 'A'; $a[] = 'B'; $_SESSION['arr'] = $a; echo '<pre>'; print_r($_SESSION['arr']); $arr = serialize($_SESSION['arr']); print_r($_SESSION['arr']); echo '<br/>'; print_r($arr); ?> Expected result: ---------------- Array ( [0] => A [1] => B ) Array ( [0] => A [1] => B ) a:2:{i:0;s:1:"A";i:1;s:1:"B";} Actual result: -------------- Array ( [0] => A [1] => B ) a:2:{i:0;s:1:"A";i:1;s:1:"B";} a:2:{i:0;s:1:"A";i:1;s:1:"B";}