SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict eanimator's Avatar
    Join Date
    Sep 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    __autoload maigc function

    Hello,

    Can any one elaborate about __autoload function and its advantages/disadvantages? Plus, its application wide-end examples

    Awaiting your response.

    Thanks....

  2. #2
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,396
    Mentioned
    54 Post(s)
    Tagged
    0 Thread(s)
    To get an idea of where you're at, have you read autoloading objects in the PHP manual?
    Salathe
    Software Developer and PHP Manual Author.

  3. #3
    SitePoint Addict eanimator's Avatar
    Join Date
    Sep 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anything else?

  4. #4
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,396
    Mentioned
    54 Post(s)
    Tagged
    0 Thread(s)
    Have you read that page, or not? 1. It covers most of what you'll want to know. 2. We don't want to be repeating things you already know!
    Salathe
    Software Developer and PHP Manual Author.

  5. #5
    SitePoint Addict eanimator's Avatar
    Join Date
    Sep 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont want to read the code but the concepts. which you people may provide.

  6. #6
    SitePoint Guru
    Join Date
    Jun 2006
    Posts
    638
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Idea is this:
    - you code it in such a way so when you add new classes, you never have to edit your __autoload function / includes ever again.

    - it's slower than normal includes. (not 100% sure by how much, but on some profiling with a heavy code, the autoload spent around 40% of the time of the script... includes for the same script were 20%)

  7. #7
    SitePoint Addict eanimator's Avatar
    Join Date
    Sep 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Performance issues?

    To include classes which may never need for a request. Why should scripts include these files/classes ? I guess its an additional thing.

    __autoload has performance issues? did you mean that?

  8. #8
    SitePoint Guru
    Join Date
    Jun 2006
    Posts
    638
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    read up on it on the PHP manual, and you will understand.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •