If you look at an example of roundcube file config (config.inc.php), they have example with and without trailing comma.
This array defines what plugins should be enabled or disabled:
...
// List of active plugins (in plugins/ directory)
$config['plugins'] = array(
'managesieve',
'password',
'archive',
'zipdownload',
);
...
Normally, this would be line by line and if somebody wants to add something on the array, they can do this:
...
// List of active plugins (in plugins/ directory)
$config['plugins'] = array(
'managesieve', //code by personA
'password', //code by personA
'archive', //code by personA
'zipdownload', //code by personA
'newplugin', //new code by personB
);
...
So, when they commit this code, they see only one changes for that particular line and this is more readable when inspecting who is making the code changes for that particular line.
In another line of code you can see this without trailing comma:
...
$config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'INBOX.spam', 'Trash');
...
Normally it would be a single line of code where nobody expects this code to be changed frequently.
In another word:
1) Put trailing comma if the array is used as an option or configuration file that might need to be changed dynamically in the future. Besides, if you make changes to that array programmatically using trailing comma you only make changes to one line code, whereas without it, you have to deal with 2 line of codes and this can cause more complexity to parse the array
2) You don't have to put trailing comma if the array is a constant array and you don't expect it to change in the future but as mentioned by the Accepted Answer, you can put trailing comma but it has no purpose