diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-02-25 13:24:02 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-02-25 13:24:02 +0100 |
commit | 65b36f1b321a71578cd8b568b4a04ef27c6b714a (patch) | |
tree | 6b1f69dbecff1b7e08e5efcd2787769a91671023 /src/standard.php | |
parent | 54b4040a8e46c4104e228264fa57b44d17e245c9 (diff) |
Diffstat (limited to 'src/standard.php')
-rw-r--r-- | src/standard.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/standard.php b/src/standard.php index 351c9e8..6cc6be6 100644 --- a/src/standard.php +++ b/src/standard.php @@ -11,8 +11,25 @@ $import = function (string $library) { $nodes = $parser->parse(); }; -$print = function (string $string) { +$print = function (string $string): void { echo $string; }; -return compact("import", "print"); +$dump = function (mixed $value): void { + var_dump($value); +}; + +$strlen = function (string $string) { + return strlen($string); +}; + +$get_char = function (string $input, int $position): string { + return $input[$position]; +}; + +$array_append = function (array $array, mixed $value): array { + $array[] = $value; + return $array; +}; + +return compact("import", "print", "dump", "strlen", "get_char", "array_append"); |