For realtive / absolute convention i suggest relative, but maybe is just me. It allows your code to be relocated easier.
Then , curiosly , i checked php source code and opendir is wrapped around various c functions and one of those is
php_check_open_basedir
313 while (ptr && *ptr) {
314 end = strchr(ptr, DEFAULT_DIR_SEPARATOR);
315 if (end != NULL) {
316 *end = '\0';
317 end++;
318 }
319
320 if (php_check_specific_open_basedir(ptr, path TSRMLS_CC) == 0) {
321 efree(pathbuf);
322 return 0;
323 }
324
325 ptr = end;
326 }
So basically it loops in your path jumping from one DEFAULT_DIR_SEPARATOR to another. So i guess, less you have the better is.
Also reading your code, but maybe is just my taste: USing $dir."/".$filename looks better than $dir.$filename
Anyway no real world difference i guess.