Nothing wrong with the array syntax (You should quote your array indices. PHP shouldn't let you get away with not using them, instead it just warns you if you don't. The manual warns against unquoted associative array indices. I'd use single quotes myself, but that's just me.) - assuming the set_file function does take an associative array.
The problem comes from your warning levels being set too high. What's happening is that you're creating an array with an index of 'MyTemplate', without first warning PHP that you were going to do so. I can't see how you were supposed to do so in that situation, though (the array itself is unnamed) so IMO PHP's warning is too paranoid.
So turn off Notices. Either in php.ini with
error_reporting = 7
or in the offending script with
error_reporting(E_ALL&~E_NOTICE);
(See the manual for explanations)