I think dirname is better, but can't use it without excluding PE (stdlib 4.x)
There is a test, already in place that covers this I think.  Is there additional tests you'd like?