What is the best way to make sure Array in PHP are closed correctly I wonder how to determine when to close an array. I edited a aliases.drush.php and added a database array but now, while I have multiple array I got a syntax error. Is there a easy rule to remember how to close an array without getting syntax errors when a file has about 300 lines?
It is no longer necessary to put databases into your Drush alias file. In older versions of Drush, a databases record in an alias file could be used to allow Drush to do an sql-sync to or from a remote system that did not have Drush installed.  This feature is no longer supported, and the databases record is no longer necessary.

To answer your specific question, though, any php nested array must have balanced parenthesis.  Make sure that you have one ( for every ). Folks usually keep track of their parenthesis via indentation -- add a level of indentation for each (, and remove it for each ).