Maybe this is a stupid question, but at the end of my pages i set all of the variables to null and then unset them, for performance, even though, i know, it probably has little to no effect on performance, but even so, would that have any effect on any caching modules, such as , varnish, apc, or memcached?
It doesn't affect anything except for (maybe) the garbage collection. Look here at how APC works. Most other caching plugins work the same way.
You'll notice that cachers like APC (memcached has nothing to do with this question, by the way - and neither does Varnish) still parse all PHP. The only thing unsetting variables may do is cause the garbage collector to kick in. If the GC kicks in, you may see a slow-down (and then, a speed-up). With that said, though, it's not very deterministic. Usually PHP is pretty good about garbage collection, so you shouldn't worry about it unless you're trying to emulate some sort of RAII behavior.
Varnish is an HTTP accelerator (that has nothing to do with PHP). memcached is a distributed memory-based information store (which also has nothing to do with PHP's inner workings).