php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53414 autoload problem in class destructor
Submitted: 2010-11-26 14:27 UTC Modified: 2010-11-26 21:36 UTC
From: mv28jam at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.14 OS: WindowsXP/Linux Fedora
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mv28jam at gmail dot com
New email:
PHP Version: OS:

 

 [2010-11-26 14:27 UTC] mv28jam at gmail dot com
Description:
------------
__autoload does not works in class destructor when path in autoload is relative

Test script:
---------------
function __autoload($class_name){
	$res=include_once('./'.$class_name.'.class.php');
}
class Test1{
	public function __destruct(){
		$obj = new Test2;
	}
}
$test= new Test1;

//other file
class Test2{}

Expected result:
----------------
class autoload

Actual result:
--------------
on windows

Warning: include_once(./Test2.class.php) [function.include-once]: failed to open stream: No such file or directory in C:\VertrigoServ\www\index.php on line 3

same on Fedora

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-26 14:29 UTC] mv28jam at gmail dot com
-Summary: static class property __autoload problem +Summary: autoload problem in class destructor
 [2010-11-26 14:29 UTC] mv28jam at gmail dot com
rename
 [2010-11-26 14:29 UTC] mv28jam at gmail dot com
rename
 [2010-11-26 21:36 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2010-11-26 21:36 UTC] johannes@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

Some SAPIs change the working directory before starting the shutdown. Nothing we can change.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Mar 12 11:01:32 2025 UTC