magnetica Posted July 22, 2010 Share Posted July 22, 2010 Hi All Consider the following script where the 'file_containing_class.php' is say 50kb in size but $name only uses a portion of the file that is say 1kb require_once 'file_containing_class.php' $class = new Class; //$namewould be something like Tom etc $name = $class->getName(); Does the user have to download the whole php file or just the part that is being called? So here would the user download the whole 50kb or just the 1kb being called? Thanks, Magnetica Quote Link to comment Share on other sites More sharing options...
dezkit Posted July 22, 2010 Share Posted July 22, 2010 50kb Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 22, 2010 Share Posted July 22, 2010 The user doesn't download any php code. Php is a server side scripting language. Php would however read the whole include/require file on the server. Quote Link to comment Share on other sites More sharing options...
magnetica Posted July 22, 2010 Author Share Posted July 22, 2010 Ok thanks. So the user wouldn't directly download the php file. php would however read the whole include/require file on the server. So would the user still have to wait for the server to download and read the whole file? Or does the file not have to download it but just find it? Thanks, Magnetica Quote Link to comment Share on other sites More sharing options...
Alex Posted July 22, 2010 Share Posted July 22, 2010 If you're including a local file it doesn't have to be downloaded at all. It just had to be read by PHP. The difference between including a 1kb and 50kb file won't be noticeable. Quote Link to comment Share on other sites More sharing options...
magnetica Posted July 22, 2010 Author Share Posted July 22, 2010 Ok so to clarify! Don't worry too much about the size of php scripts. Worry more so about image sizes, html page sizes etc then yea? Magnetica Quote Link to comment Share on other sites More sharing options...
timvdalen Posted July 22, 2010 Share Posted July 22, 2010 Ok so to clarify! Don't worry too much about the size of php scripts. Worry more so about image sizes, html page sizes etc then yea? Magnetica Exactly Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.