php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40511 __destruct() does not destroy vars $var
Submitted: 2007-02-16 20:06 UTC Modified: 2007-02-16 20:29 UTC
From: afuzaylov at mlgpro dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.1 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: afuzaylov at mlgpro dot com
New email:
PHP Version: OS:

 

 [2007-02-16 20:06 UTC] afuzaylov at mlgpro dot com
Description:
------------
I have a class that has __destruct() in there.

When I call the $process->__destruct(), shouldn't it destroy the whole class, all the functions and variables associated with it and all the com objects?

Reproduce code:
---------------
class CProcess {
  var $fsize;

  function __construct($fsize) {
    $this->$fsize = $fsize;
  }

  function __destruct() {
  }
}

$process = new CProcess(15);

$process->__destruct();

Expected result:
----------------
All the vars should be destroyed.

Actual result:
--------------
The vars stay in memory

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-16 20:12 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Nope, it shouldn't.
 [2007-02-16 20:14 UTC] afuzaylov at mlgpro dot com
Then how do I destroy the class completely? I need it destroyed to continue with the next statement...
 [2007-02-16 20:29 UTC] tony2001@php.net
unset()
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC