ID:               24908
 Updated by:       [EMAIL PROTECTED]
 Reported By:      itotakas at msu dot edu
 Status:           Verified
 Bug Type:         Scripting Engine problem
-Operating System: all
+Operating System: *
 PHP Version:      5CVS-2003-08-01 (dev)
 New Comment:

Also see #24914


Previous Comments:
------------------------------------------------------------------------

[2003-08-10 22:28:15] [EMAIL PROTECTED]

The problem will occur when any super global is used from within
__destruct.
Here is a simpler example:
<?php
class test { function __destruct() { print_r($_ENV); } }
$test = new test();
?>


------------------------------------------------------------------------

[2003-08-01 20:40:35] [EMAIL PROTECTED]

[php5]# sapi/cli/php t.php 

/usr/src/web/php/php5/Zend/zend_hash.c(841) : ht=0x08662bf0 is being
destroyed



------------------------------------------------------------------------

[2003-08-01 12:33:10] itotakas at msu dot edu

Description:
------------
$_SESSION variable should be "array" and "super global".
However, within the __destrunct function, $_SESSION changes its value
to the reference to the class which implements __destruct function.

[Example]
<?
  session_start();
  $_SESSION["test"] = "test string";

  class test {
      function __destruct()
      {
          // $_SESSION = $this !?
          print_r($_SESSION);
      }
  }

  $test = new test;
?>

[Expected result]
Array ( [test] => test string )

[Actual result]
test Object ( )

Reproduce code:
---------------
<?
  session_start();
  $_SESSION["test"] = "test string";

  class test {
      function __destruct()
      {
          // $_SESSION = $this !?
          print_r($_SESSION);
      }
  }

  $test = new test;
?>

Expected result:
----------------
Array ( [test] => test string )

Actual result:
--------------
test Object ( )


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24908&edit=1

Reply via email to