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
https://forums.phpfreaks.com/topic/76697-php-load-efficient-programming/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.