php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46177 Require is triggering autoload function
Submitted: 2008-09-25 23:12 UTC Modified: 2008-09-26 19:48 UTC
From: Antoniocs at gmail dot com Assigned:
Status: Not a bug Package: Dynamic loading
PHP Version: 5.2.6 OS: windows XP sp3
Private report: No CVE-ID: None
 [2008-09-25 23:12 UTC] Antoniocs at gmail dot com
Description:
------------
Require triggers __autoload

Reproduce code:
---------------
File teste.php 

<?php
class teste extends acs_activerecord {
    public function __construct() {
        parent::__construct();    
    }       
}
?>

File other.php

require("teste.php");

This will trigger my autoload function (which is declared and included, but not shown here), which will try to load the file where the acs_activerecord is

Expected result:
----------------
I would expect it not to trigger the autoload function.
The autoload function should be triggered when I instantiate the class teste

Actual result:
--------------
I have xdedub and the cachegrind shows the autoload function being called when the file teste.php is required

http://img142.imageshack.us/img142/2047/loadproblemug6.jpg

Here is a link to the image of the cachegrind file.I have placed a little arrow indicating the file

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-26 19:48 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

The engine tries to bind the class emmbers and has to check the parent class for missing implementation of abstract elements and therelike. That's expected
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 19:01:31 2024 UTC