Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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?

3 answers

This continues to be an issue with SourceTree even into PHP 7.3. SourceTree for Mac uses the version of PHP that ships with Mac OS, not necessarily the version that Homebrew and/or .bash change to use. It would be great if the product gave an option to change PHP version as the host machine also uses other methods of changing.

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

0 votes
bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 20, 2017

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)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events