It depends on what somefile.php
will contain. Variables can be freed using unset()
on all(!) references of the variable. However, they got "really" freed after the next run of the garbage collector. You can trigger the garbage collector manually but in most situations it is better to let it "just do its work" on its own.
Functions , classes and constants can't be freed once they have been created, however closures can (as they are like variables).