Quote from dirname() docs:
dirname() operates naively on the input string, and is not aware of the actual filesystem, or path components such as "..".
Therefore, dirname( "a/b/c/.." ) will yield "a/b/c" which is not what I want.
>> It's completely unnecessary
Wouldn't say that it is COMPLETELY unnecessary. Otherwise, why do we have dirname() in first place? We have "..", right?
One of valid use cases is to keep paths without ".." bloat.