Tools; they can make your life amazingly productive or hellishly frustrating. Over the past decade I have had the privilege to use a wide range of tools. From CLI output parses to full on SaaS IDEs with 3rd party service integrations to automatic code style fixers. Some are better than others, some more mature than others. Here I would like to share with you my 5 go to tools. When starting up a projects these tools make my life, personally, an enjoyable ride down the PHP road.
-
xDebug - If you do not use a debugger, please, please, please give one a try. If not xDebug (which is the best of bread for PHP in my opinion) then one of the many others.
print_r($VAR);exit();
is a time waster. Break points are the way to go, request stepping, variable watching. These things save you time and frustration. The amount of time debuggers has saved me it worth whatever it costs to show appreciation to Derick Rethans. xDebug is one of THE best tools for PHP development, hands down. I can not promote this enough.
- PHPStorm - When it comes to development a good IDE is a requirement. While we could go on for hours with the difference between an editor and an IDE; PHPStorm is a professional IDE. Tool integration, type hinting, productivity enhancements. It's all there. In addition to an very community active vendor and community there is literally nothing in the plugin library that you could need and not find.
- xhprof & flame graphs - Need to find where your program is being slow? Profiling. Need to trace a request execution? Profiling. Need to figure out what function/method is called by who? Profiling. xhprof official support may have died but the number of forks are still very much active. Coupled with the flame graph scripts the output is not only pretty looking but also very useful.
- PHPUnit - The one, the only, the bases for the vast majority of all other PHP based testing suits; PHPUnit. If you do testing (and you SHOULD BE) then PHPUnit is your tool.
- Code Quality tools (PHPCS / PHPCPD / PHPMD) - While I try to program at a level of professionalism mistakes happen. An extra space here, and badly designed method there. Tools like these help you produce the best code logic possible. I often trigger these type of tools via a GiT pre-commit hook. While not necessary, nor really required, help enforce a level of quality logic output.
I firmly, and wholly heartily, believe that leveraging a good tool set during development can make your day-to-day as a software engineer an enjoyable one.
Top comments (5)
Good list. I would also add phpstan as a must-have for static analysis. GrumPHP is also useful for sniffing commits and can be configured to run php-cs, php-md, unit tests, phpstan etc etc.
Edit: this one's obvious but can't do jack without Composer!
Total agree! Composer, phpstan and grumphp are all three amazing tools.
Very nice summary David! We basically use exactly this stack. In addition we make heavy use of Codeception, which fits perfectly into this stack (including PHPStorm support). That allows us to also have browser tests integrated in one stack so that we could get rid of all heavy external testing tools.
Thank you @frantzen , glad you liked the article. I as well have used Codeception extensively in the past. If you dig into it enough it eventually turns into PHPUnit; per Codeceptions own documentation" Codeception uses PHPUnit as a backend for running tests. Thus, any PHPUnit test can be added to Codeception test suite and then executed." - codeception.com/docs-1.8/06-UnitTests
Thank you again for the comment! :D
UPDATE: Added a Link List on my blog with PHP Tools. blog.davidjeddy.com/?page_id=56 . I will update this as more tools come into my viewing range. Thank you all again for the great suggestions!