← All docs
count_chars()
Returns byte-frequency information about a string as a tally or a byte list.
count_chars()
function count_chars(string $string, int $mode = 0): array|string
Returns byte-frequency information about a string as a tally or a byte list.
Parameters:
$string(string)$mode(int), default0, optional
Returns: array|string
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/count_chars.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how count_chars is implemented in the compiler, see the internals page.