From: Operating system: windows/linux/... PHP version: 5.3.3 Package: Output Control Bug Type: Bug Bug description:The Bug of unset
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 bug report at http://bugs.php.net/bug.php?id=52970&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52970&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52970&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52970&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52970&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52970&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52970&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52970&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52970&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52970&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52970&r=support Expected behavior: http://bugs.php.net/fix.php?id=52970&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52970&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52970&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52970&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52970&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52970&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52970&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52970&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52970&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52970&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52970&r=mysqlcfg