This code fails on some machines:
// Parse error: syntax error, unexpected '[' ...
return json_encode(self::GenerateSomeAssociativeArray($meta_file)["list"]);
but this effectively identical version works on all machines:
$foo = self::GenerateSomeAssociativeArray($meta_file);
return json_encode($foo['list']);
I assume it’s a versioning issue, but I’m unable to find information on the difference, probably because I’m unfamiliar with the terminology to search.
The first example you gave is for PHP 5.4 and supposedly higher.
See the following PHP 5.4 release announcement:
http://php.net/releases/5_4_0.php