3 ms·
That is just another piece of metadata. But it does not help either. Now you know you get an array of strings. But you still don't know what is inside of the st
by TooCreative 6y ago
That is just another piece of metadata. But it does not help either. Now you know you get an array of strings. But you still don't know what is inside of the strings.
It might be ['headers'=>'...','body'=>'...' ] or ['status'=>'...','response'=>'...'] or god knows what.
And you are back to reading the function body.
- mplanchard 6y agoIs that like a hashed array you’re implying? In that case, the type wouldn’t be string anyway, but something like HashMap, Object, Dict, etc. More commonly though, something like HTTP options would be its own type, with defined properties, which you could browse via autocomplete or your IDE’s hover/peek functionality. That type would then specify the types of its values, so you can be certain that options.status is an integer, for example. You’d generally only use an otherwise untyped array of strings when you can’t know beforehand what their values can be.