SourceTree PHP 5.6+ Issue

We currently have a githook that calls some code that is written in PHP that executes codesniffer and other actions during each commit process. This code has a use statement in it that relies on use const syntax that should be stable (it works just fine in the command line) but for some reason, it triggers the following error inside of SourceTree. This syntax is valid in PHP beyond PHP 5.6.

Parse error: parse error, expecting `"identifier (T_STRING)"' or `"\\ (T_NS_SEPARATOR)"

Normally I wouldn't post a code error like this, but the code does execute fine from the terminal, so it's clearly something going on in SourceTree itself.  Any thoughts?

2 answers

0 votes

What OS and version of SourceTree are you using?

Brian Ganninger
Senior Mac Developer, SourceTree

Mac OS 10.11.6 and SourceTree 2.5.3 (115)

Reading through the issue on https://community.atlassian.com/t5/Bitbucket-questions/SourceTree-Hook-failing-because-paths-don-t-s..., this seems to be the same issue. My .bash_profile is using a different version of PHP than when SourceTree runs. 

Suggest an answer

Log in or Register to answer