I was getting PHP parse errors after updating files using composer or Laravel's artisan on a VMWare Fusion 6.0.2 Debian Linux guest on a Mac host. The files were shared using VMWare Fusion's sharing settings and mounted on the guest.

tl;dr

Upgrade to the latest version of VMWare Fusion (6.0.3 at the time of this post) and re-install VMWare Tools. You may possibly need to apt-get update & apt-get upgrade. YMMV.

A little more detail about the problem

I was running:
- VMWare Fusion 6.0.2
- Debian 7 Wheezy
- Mac OSX 10.9.3

The files being updated were on the Mac host, but mounted on the Debian guest using VMWare Fusion's sharing settings.

Every time I'd update composer, or run e.g. "php artisan dump-autoload" I'd end up with PHP parse errors, such as 'PHP Parse error:  syntax error, unexpected '' => $vendorDir . '/laravel/fr' (T_ENCAPSED_AND_WHITESPACE) in [...] /vendor/composer/autoload_classmap.php on line 1952'

Running the same artisan or composer command from Terminal on the Mac would work fine.

Re-saving the file on the Mac would fix the problem.

Restarting the guest would fix the problem.

Unmounting the host filesystem and remounting it would fix the problem.

None of these solutions is any good.

The fix that worked for me

Upgrading to the latest version of VMWare Fusion (6.0.3 at the time of writing) and re-installing VMWare Tools fixed the problem.

I also do a "apt-get update & apt-get upgrade" to get Debian up to date, which I did inbetween updating Fusion and re-installing Tools. Whether you need to do this or not, I am not sure.

The only catch with this "fix" is that the probem may come back again in later updates to Fusion, and of course it may not work for you. Good luck!