Where to position include/require statements?

SoLiTaiRe

New Member
Do you position all of your \[code\]include_once\[/code\] and \[code\]require_once\[/code\] at the start of the file, so it's clear what it's dependencies are, or do you put them at the most local scope where they are used, for efficiency?Let's say I have an error handling file which has a function to display an error message - would you ...\[code\]require_once('error_handling.php');... lots of code ...if ($should_be_true === False){ ReportErrror(); // declared in error_handling.php}\[/code\]or do you\[code\]... lots of code ...if ($should_be_true === False){ require_once('error_handling.php'); ReportErrror(); // declared in error_handling.php}\[/code\]hmm, looks like they deleted the \[code\]best-practise\[/code\] tag, along with \[code\]subjective\[/code\] in the great tag purge of '10
 
Back
Top