Modified to build out formatted PHP code by hand for greater speed
Optional support for PHP 5.4+ "[]" array syntax.