|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-22 22:00 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 02:00:01 2025 UTC |
Description: ------------ In the __destructor all changes in the $_SESSION array was not saved. In the php 5.1 it's work corectly. Reproduce code: --------------- session_start(); class test { function __construct() { echo '<br />__construct <br />'; var_dump( $_SESSION ); if( empty( $_SESSION['iForConstruct'] ) ) { $_SESSION['iForConstruct'] = 1; $_SESSION['iForDestruct'] = 1; } $_SESSION['iForConstruct']++; } function __destruct() { echo '<br />__destruct'; $_SESSION['iForDestruct'] ++; } } $test = new test(); Expected result: ---------------- In the all refresh we expect incrementing the values of $_SESSION['iForConstruct'] and $_SESSION['iForDestruct'] for all refresh's Actual result: -------------- incrementing only $_SESSION['iForConstruct']