Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • @coolpasta: welcome to the world of statically typed code. Commented Nov 17, 2018 at 16:01
  • @MichaelBorgwardt Awesome, but I assume there's no way to actually also define a structure I'd want to be respected, as in my question, the array must have "this key". Commented Nov 17, 2018 at 19:21
  • 1
    My suggestion is to use an object with a class instead of an array. Generally it does the same thing, and also actually runs faster than array since the system doesn't have to search for a key by name. So instead of saveToImportantList( $export_data['main_flags'] ); you will write saveToImportantList( $export_data->getMainFlags()); Commented Nov 17, 2018 at 19:37