1
$deploy->post_deploy = function() use ($deploy) {
  // hit the wp-admin page to update any db changes
  exec('curl http://www.my.address.ipq.co/dev/build');
  $deploy->log('Doing a dev/build for silverstripe... ');
};

In Eclipse, (I'm using phpeclipse) The error is Parser error "';' expected after expression. Found token: ()

It highlights the brackets after function.

I know closures are a new feature of 5.3, so I checked the php that phpeclipse was using via preferences>php external tools and the run and parser commands were pointing to some xamp tool, so I corrected them to use my wamp installation's php.exe instead.

I've even run the same (wamp version) php.exe -l -f command on the file and it says 'No syntax errors detected in deploy.php', so this must be an eclipse configuration problem, right?

How can I fix eclipse to use the correct version of php 5.3 and accept this new syntax?

ac_
  • 1,147
  • 4
  • 13
  • 34
  • Have you tried assigning the closure to a separate variable and then setting the value of ```$deploy->post_deploy = $myclosure;``` ? – Trick Feb 17 '15 at 14:57
  • I have no idea, this is over a year old. I barely remember what I did yesterday, let alone Dec 4 2013. – ac_ Feb 18 '15 at 16:27

0 Answers0