dirname()
function dirname(string $path, int $levels = 1): string
Returns a parent directory’s path.
Parameters:
$path(string)$levels(int), default1, optional
Returns: string
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/filesystem/dirname.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how dirname is implemented in the compiler, see the internals page.