The difference is that dirs work the same whether there is a trailing slash or not, a prefix has a different meaning if you don't put the terminating backslash. That said you can always append a slash when the dir gets added, since php will internally collapse // to /