If I understand the question correctly, yes, you can provide $var as ../../../any/arbitrary/file and open a file that is not under /Library/xampp/Documents" (though if Library, xampp, or Documents is a link rather than a file, you may need a different number of ..s).