opt
/
cpanel
/
ea-wappspector
/
vendor
/
squizlabs
/
php_codesniffer
/
src
/
Standards
/
PEAR
/
Docs
/
Files
➕ New
📤 Upload
✎ Editing:
IncludingFileStandard.xml
← Back
<documentation title="Including Code"> <standard> <![CDATA[ Anywhere you are unconditionally including a class file, use <em>require_once</em>. Anywhere you are conditionally including a class file (for example, factory methods), use <em>include_once</em>. Either of these will ensure that class files are included only once. They share the same file list, so you don't need to worry about mixing them - a file included with <em>require_once</em> will not be included again by <em>include_once</em>. ]]> </standard> <standard> <![CDATA[ Note that <em>include_once</em> and <em>require_once</em> are statements, not functions. Parentheses should not surround the subject filename. ]]> </standard> <code_comparison> <code title="Valid: Used as statement."> <![CDATA[ require_once 'PHP/CodeSniffer.php'; ]]> </code> <code title="Invalid: Used as function."> <![CDATA[ require_once<em>(</em>'PHP/CodeSniffer.php'<em>)</em>; ]]> </code> </code_comparison> </documentation>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel