Bug #52970 [Opn]: The Bug of unset
| From: | ymdf at qq dot com | Date: | Sat, 02 Oct 2010 13:49:49 +0000 |
| Subject: | Bug #52970 [Opn]: The Bug of unset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-154827@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52970&edit=1
ID: 52970
User updated by: ymdf at qq dot com
Reported by: ymdf at qq dot com
Summary: The Bug of unset
Status: Open
Type: Bug
Package: Output Control
Operating System: windows/linux/...
PHP Version: 5.3.3
Block user comment: N
New Comment:
in_run: iswork
in_destruct: iswork
out $rout->run: iswork
out $rout->destruct: iswork
out unset($rout): error
Previous Comments:
------------------------------------------------------------------------
[2010-10-02 15:47:52] ymdf at qq dot com
Description:
------------
Destructor if the class has a path variable $path = 'asd.php',
Uset to call the function with a class destructor that address the
relative
position will change.
Test script:
---------------
index.php
<?php
require_once 'Router.php';
$route = new Router();
echo '<br>out $rout->run:';
$route->run();
echo '<br>out $rout->destruct:';
$route->__destruct();
echo '<br>out unset($rout):';
unset($route);
?>
Router.php
class Router {
private function __construct() {
$this->run();
echo '<br>in_destruct:';
$this->__destruct();
}
public function run() {
$f = 'App/controls/indexControl.php';
if (file_exists($f)) echo ' work';
else echo ' serror';
}
public function __destruct(){
$f = 'App/controls/indexControl'.php';
if (file_exists($f)) echo ' work';
else echo ' error';
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52970&edit=1