$commands = ['hi' => hi(), 'hello' => hello(), 'etc' => etc(), ...];
<?php
$commands = [
'hi' => fn($name) => 'hi, ' . $name,
'hello' => fn($name) => 'hello , ' . $name,
'etc' =>fn($name) => 'etc...',
];
echo $commands['hi']('John');
$commands = ['hi' => 'hi', 'hello' => 'hello', 'etc' => 'etc'];
$commands['hi']();