PHP: “Only variables can be passed by reference”

<?php $dir = “./mydirectory/”; if ($handle = opendir($dir)) {   while (false !== ($file = readdir($handle))) {     if (preg_match(“/^\..*/”,$file,$junk) || preg_match(“/^BAD.*/”,$file,$junk) || preg_match(“/^TEST.*/”,$file,junk){       //Skip it       print “Skip: $file\n”;     }else{       //We want to edit this file       print “–EDITING–: $file\n”;     }   }   closedir($handle); } ?> This isn’t exactly the most complicated piece of code, but it was extremely annoying when I got the error “Only variables can be passed by reference” back from...