Which text editors/ IDEs do you guys use to write PHP? which do you like most?
Text editors/ IDEs
I use simply Notepad++
Notepad++ has styling for PHP. You can chose colors for the code.
Visual Studio or notepad++
I've also switched my main IDE from NetBeans to VS Code within the last couple of years. Notepad++ gets some use, as does Nano or even VI depending on where I am and what I'm doing.
- Edited
Nano got quite a bit of use this morning, as I discovered a 3rd-party JS signup form had broken the layout of four different properties' homepages this morning. #30MinuteHeadScratch
My preferred CLI editor is nano, which is super handy for triage actions on a running server. On my Ubuntu workstation, I use Eclipse PDT. It has not just code formatting with colors and such, but you can also look up functions and objects by putting the cursor in them and hitting the F3 key. This takes you immediately to the function or object definition. It also provides autocompletion as you type, which provides suggestions for functions, classes, methods, your own variables, and parameters for functions and methods. If you bother to write your own javadoc style comments, you can control the information available in the autocompletion popups for your own classes and objects. In my reckoning, these features are vital in any IDE that you might use because they address the most tedious aspects of PHP coding: remembering the exact names of functions and class names, remembering the sequence of parameters supplied to various functions, and understanding the inner workings of functions.
That said, I haven't had much luck setting up Eclipse to step through my code if my code runs on apache. It is possible to establish a channel of communication between apache and eclipse to do this, but it's a pain in the ass and breaks easily. I vaguely recall using Xdebug for this purpose. It's been a long time since I bothered to try this. My coding style has evolved to use logging to inspect objects and identify problems.
sneakyimp That said, I haven't had much luck setting up Eclipse to step through my code
Way back when I tried to set up debugging in Eclipse and never succeeded.
FWIW, VS Code has some pretty good "intellisense" plug-ins for PHP. Even more than PHP built-in function syntax/params, I especially like how you can right-click on a user-defined function/method call, and view the source code for it to see what it actually does -- assuming how stuff gets included in your app can be deciphered by it.
NogDog I'm pleased to see that VS Code is also available for Linux.
As for right-clicking on a user-defined function/method, that's essentially what Eclipse offers with the F3 button. Eclipse opens the file that defines the function so you can read the source right there. You can click Alt-left-cursor to go back to where you were before (like clicking 'back' in a browser). Personally, I like maintaining javadoc-style comments for my methods and functions because I can specify whatever detail I consider most important when considering the use of the function. Also, if you indicate what data type the parameters are in your javadoc comments, this yields more detailed autocomplete options for your user-defined instances of your user-defined classes.
cluelessPHP
If you're using Visual Studio, have you also looked at PeachPie? Basically PHP.NET.
Weedpacket I haven't but I will look at it after work