If you are a Linux or Mac user, you can do this.
Tools → Build System → New Build System
{ "cmd": ["php" , "$file"] }
It will run your php codes on an elevated text console
here is a screenshot if you are wondering what it looks like.

Anar bayramov
source share