You can have local arrays, but for some reason you can't assign values to them on the same line they are defined like you can with global arrays. (Possibly a bug)
Your code is defining a local array, but failing to set any values to it because of this. If you set a value in the array on a separate line it's value will show.
eg:
function test_function()
layers$ as string[4] = [ "o", "b", "r", "s", "h" ]
layers$[1] = "B"
layer as integer
for layer=0 to layers$.length
print(str(layer)+"."+layers$[layer])
next
endfunction