Given an array like
array('apple', 'pear', 'banana'); features_var_export() would export something like
0 => 'apple',
1 => 'pear',
2 => 'banana',
However, it should really export without those keys:
And the reason is that if we export (and commit with a VCS), the first example and then change our array to
array('apple', 'pear', 'lemon', 'banana'); we would get an absolute mess in our git diff, because all of those keys will have changed so unaffected lines would show as changed.
drupal_var_export has a very elegant solution to this problem:
$export_keys = array_values($var) != $var;
If the array_values of the array match the array itself then don't bother putting indexes before each key.
I was concerned about performance on this, so I've been profiling for a few weeks on some of my larger features and it's not adding more than a couple of milliseconds per rebuild so I'm happy to propose this as a patch.