If I have a simple script like the following where the test.php file is a huge pile of inefficient code which will slow my site to a crawl:
Code php:<?php function test() { require('test.php'); } test();
Would it run slower than the following?
Code php:<?php function test() { require('test.php'); }
ie: Does the test.php script run when the function is declared, when it is used or both times?
I'm trying to improve the efficiency of some of my scripts and am wondering if there is any point in adding IF statements so that the functions aren't created unneccessarily.
Thanks for your advice![]()








Bookmarks