Because thats how it works. You can access characters in a string in array like way with indexes. But the string is not really an array even tho you can do that. You can’t for example use array functions with the string.
$var_name = 'var';
echo $var_name[0]; // Prints "v"
echo $var_name[1]; // Prints "a"
echo $var_name[2]; // Prints "r"
echo $var_name[3]; // Notice: Uninitialized string offset: 3