Page 1 of 1

Close an included file?

Posted: Tue May 09, 2006 5:51 pm
by HiddenS3crets
Is there a way to close an included file when it is not needed anymore?

Ex:

Code: Select all

<?php
// Include file
include("/file.inc");

// Create new object
$current = new file;

// Perform a function
$current->someFunction();

// After this, file.inc is not needed anymore.
// Can it be closed so it cannot be accessed again (unless it is included again somewhere further down of course)
?>

Posted: Tue May 09, 2006 6:16 pm
by hawleyjr
You are not opening the file per-say. you are including it, therefore no you can't open and close it.

Posted: Tue May 09, 2006 6:19 pm
by Christopher
With PHP, all files and other connections are closed, and all memory freed when the script ends.