php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50735 feature request
Submitted: 2010-01-13 02:15 UTC Modified: 2010-01-13 12:06 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: h dot riepma at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.12 OS: ubuntu
Private report: No CVE-ID: None
 [2010-01-13 02:15 UTC] h dot riepma at gmail dot com
Description:
------------
not a bug, but http://www.php.net/sitemap.php said to put features here too...

would love to have __autoload effect functions as well as classes...

Reproduce code:
---------------
<?
__autoload($n){
 if(!function_exists($n)) require_once('functions/'.$n);
}
n_md5('test');
?>

Expected result:
----------------
functions/n_md5 required automatically and ran as normal

Actual result:
--------------
Fatal error: Call to undefined function n_md5() in /var/www/autoload.php on line 5

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-13 02:18 UTC] h dot riepma at gmail dot com
yes i know theres a logic error there...

<?
__autoload($n){
 if(!function_exists('functions/'.$n)) require_once('functions/'.$n);
}
n_md5('test');
?>
 [2010-01-13 12:06 UTC] jani@php.net
Please, go away troll elsewhere. And you can already do that if you know what you're doing.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Aug 08 05:00:02 2025 UTC