basename()
function basename(string $path, string $suffix = ''): string
Returns the trailing name component of a path.
Parameters:
$path(string)$suffix(string), default'', 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/basename.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how basename is implemented in the compiler, see the internals page.