Jump to content

PHP Load + efficient programming


chantown

Recommended Posts

I have a question about INCLUDING files.  For example, let's say this file is

 

FOOBAR.PHP:

 

<?php

 

class bar {

function here..  //There are 10000 lines of code in this class

function here.

}

foo = new bar();

 

?>

 

OK, so I have this FOOBAR.PHP I include.  Let's say I don't even USE every function in foobar.php....I only use it for a couple functions, which total like 100 lines.

Does that slow down my entire script if I include the whole file (because the PHP interpreter runs through 10000 lines of code?).

 

 

Link to comment
Share on other sites

All I can tell ya is this...

 

If there's a parse error in a function, the script will error out even if the function hasn't been called, and even if that function is at the bottom of a 1,000 function library, so... there you go. PHP reads every character of the script before it does anything else.

 

What does it mean...?

 

It means you'd have to do some benchmarking to make any sense of it.

 

PhREEEk

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.