According to a poll here on StackOverflow, NetBeans is the best PHP IDE available. This is all fine and good, except for one thing: It appears to be terrible at checking syntax. I'm sure I must be doing something wrong?
I've previously used phpDesigner, which is a great program, but I've only got version 2007, and it doesn't support xDebug (I'd have to buy the new version if I wanted that). So I thought I'd try the much vaunted (and free) NetBeans.
But, as far as I can tell, it's syntax checking is horrible. For example: Note how the same file is handled by the two different IDEs.
First phpDesigner:
Pretty obvious where the problem is, right?
Then NetBeans:
Here there is nothing but a vague error message at the very bottom of the class, and it's not even near the function causing the error(!).
So my question is: Is it possible to get better syntax checking in NetBeans? I'm presuming there must be a way, and I'm just being really dumb.
Additionally: If this is not possible in NetBeans, what other free IDEs are available that do have this level of syntax checking?
Thanks for any help.
Some people have suggested Eclipse as a replacement, so I thought I'd test it.
It too correctly recognises the syntax error. (Makes me wonder if NetBeans is bugged.) I may just switch to Eclipse. Are there any other IDEs people think are worth trying?
Well it turns out that it's a bug in NetBeans. Here's the details of the bug:
http://netbeans.org/bugzilla/show_bug.cgi?id=168350
Update: It's been fixed in NetBeans 7.0.
I don't now much about NetBeans but why don't you try Eclipse with PDT? It has better syntax checking as NetBeans. Using the example presented in your post Eclipse will display the same error message as PHPDesigner (and in the right place). Give it a try.
Personally, I use (and love) VIM as an IDE, but at work we have to work with Eclipse and I think it will suits your needs.
Related
I got a question about the IDEs: With Java, you use Netbeans or Eclipse, which are very great IDEs to code. Now, if I do a misspelling, Eclipse reports it immediately with a red line (for example a function call which was misspelled).
As I know, this works with some sort of dummy-compiling on the fly.
Now, why is there no IDE at all which provides the same stuff for PHP? Just a sort of "on the fly-interpreting" which does not really execute all functions, but it interprets the code. It would sometimes make programming much easier. Is this possible at all? If no, why not?
Thanks for response ;)
Flo
The PDT Development Tools plugin for Eclipse does exactly that. Just tell it where your PHP interpreter sits. And keep in mind that it of course can't catch errors that occur at runtime. So it will only report actual syntax errors.
I am quite new with development. In some programming language such as python and PHP there is not a good debugger. How is the development going on without a debugger? just put the logs in the source code? Especially for the framework developers, how do they test their codes?
Thank you very much.
-Stefan-
Your answer concerning the debugging in Python is truly nonsense. Python has a reasonable "pdb" debugger which is useful since years. Apart from that you can have a powerful IDE as WingIDE giving you all debugging and inspection power you need. Making such wild claims about Python is not appropriate. That's why this question deserves a clear downvote.
You don't seem to have looked around before coming to your conclusion. I've worked with two excellent debuggers for PHP. Xdebug and ZendDebug. If you have an IDE like Eclipse or NetBeans (both free), it's super easy to debug your app. Just click on the debug menu button :)
Xdebug : http://www.xdebug.org/
Zend Debug : http://www.zend.com/en/community/pdt
Eclipse PDT : http://www.eclipse.org/pdt/
Netbeans : http://netbeans.org/
Python has a debugger: pdb. If you use Werkzeug, then you can also access each frame of a stack trace and debug there on an error
I am not a python developer, but in case of PHP,we do have a debugger. Setting it up and getting to work with it might not be as easy as C# (with VS) or other programming languages. PHP itself is developing and becoming better.
Putting logs is very important and good way to debug. You could also have some print statements, for debugging. Apart from that, you can make use of PHPeclipse IDE and use the debugger. This will help you create breakpoints etc..
You could also setup error reporting in PHP.
Refer to this article for setting up you development environment.
python -m pdb foo.py
And even without using that, usually you get detailed tracebacks when an error happens so many people don't know about pdb because they can just read the error message containing everything they ever wanted to know. It's not like C where it just goes boom and says "Segmentation fault" and leaves you with nothing to work on.
I have been searching for the perfect web development IDE for some time now. I first started coding with notepad when all I wrote was HTML. Clearly, that was a relationship not meant to last.
Eventually I discovered Notepad++ and the wonderful syntax highlighting that it does. However, I got frustrated when I started working with server-side code and eventually moved to Netbeans, which I have been using for about a year now.
I enjoy using Netbeans quite a bit. The syntax highlighting is fantastic, the ability to push a button and step through your server side code (once you get your apache server set up properly). And the diff engine on it is fantastic for viewing code side by side. I dislike the learning curve (it seems awfully steep to me), and I've recently wanted to try Zen coding, which I can't do with Netbeans.
So, I am looking for an IDE that allows stepping through server side code, and the ability to install plugins such as zencoding. A good Diff engine would be fantastic (but not a dealbreaker), and making code versioning a bit easier would also be points for it.
Here are some choices:
EngInSite
Eclipse
Komodo
phpDesigner
Zend Studio
While I myself enjoy the simpler things in life such as VI or even notepad++. Your problem is going to arise when you want to do debugging, as you found it requires an apache plugin. My best recommendation to you would to look at zend studio although it is not free. I've used it with non zend framework apps, and its pretty handy.
As Stijntjhe mentioned zend studio , if you want free software , use eclipse or eclipse pdt.
Netbeans also could be good for it.
Hi recently i have started the same journey. And my main choices where eclipse with WPT, Aptana en Netbeans. And After a while I returned to Netbeans 7 beta. Which suits me perfectly fine. It is helps me in a robust way which in the end matter the most to me.
The Zeus IDE has support for HTML, CSS and Zen coding.
Zend Studio for Eclipse, I used it a while ago when I was still a windows user.
Html-Kit is also a good editor but if you're more advanced I prefer the first one.
Adobe Dreamweaver is also an excellent Web IDE. It is pricey (if you purchase it).
The best versions are MX2004, CS4, and CS5.
Surprised no one has mentioned UEStudio yet. It is not free, but is one of the more powerful editors out there.
And I second netbeans as well.
I've been battling with several IDE's so far without much success, so I decided it would be ask someone wiser. I'd love one to have these features:
Fast code completion;
Completion for HTML (with tags and tags' content), CSS and, preferably, jQuery;
Debugger which can work with WampServer installation;
Completion for native PHP commands as well
Shortcut to go to a file in the current project/workspace (like Ctrl+Shift+O in Netbeans) --> What I meant here is that a shortcut to open a window, where you can type beginning of a file name and it will show you all matching files in project; so a way to navigate the project with keyboard only.
I have already tried some of IDE's:
Netbeans:
It is slow, really slow. The slowest IDE of them all I believe
Debugger had issues and overall I failed to make it work
You can barely customize auto-formatting (at least in the way I'd like to customize it) - you can either disable it or live with it
I am using it right now but strive to change it!
Eclipse PDT
Kinda slowish, though faster than Netbeans
There was no code hinting for native PHP commands #_#
After restarting IDE, the Debugger decided to stop adding ?X-DEBUGwhatever stuff to links and it stopped working as result
Subclipse didn't work!
Nusphere PHP Edit
Fast and shiny, good for my netbook, but there is no "Go to file" command
No JS hinting
Komodo and PHPDesigner 7 were disqualified for some reasons I can't really remember now but they were severe.
I tested a wide variety of IDE's but there is a real lot of them and pretty difficult to test them all, which is why I'd appreciate some input about one which fits all the above specified needs.
Consider vim. It's painful at first, but it does meet all of your requirements, unless you also have a (as of yet unspoken) requirement for a Graphical User Interface.
Fast Code Completion: Fastest I've ever encountered, C-x C-o
Yes, Yes, and Probably.
vim can use xdebug to get this functionality. How to set up on linux.
Yes.
:o supports tabbed completion even.
PHPStorm is a relatively new contender in the IDE scene by the people who make IDEA and Resharper. I can't say it's blazingly fast, but it's geared specifically toward PHP and has a lot of nice features. I feel it is a considerable improvement over Netbeans or Eclipse.
You might want to try the pre-release of the next version, since they've added a lot of new features.
Funnily enough I decided to settle for Aptana 3 Beta. Though lots of features don't work it is awfully quick and I love the antialiased font. Thanks to all for help anyway!
It seems that eclipse has always had some flaky auto-complete functionality. I'm now using Helios and still have trouble with eclipse refusing to offer auto-complete on some common tags in PHP. It's really hard to guess when the auto-complete will work as it seems to change it's mind and work on/off at it's own will.
Is there something that triggers auto-complete on/off for certain elements or features?
Is there something that triggers
auto-complete on/off for certain
elements or features?
I've just checked Helio, and the only one I know off of my head and so far in preferences is Template. You can trigger auto-complete with Code template and customized it. Other than that I can't seem to find a list of php syntax that would trigger it.
If it bothers you that some element aren't getting auto complete, then perhaps you can try code template?
You can try to change your PHP version in Eclipse to 5.3?
Code assist is only a pain for me when I declare classes and I assume it'll do curly braces after I declare the class, it doesn't, it tried to add interface and abstract in there before the curly braces >_>.
Unfortunately Eclipse Helios has the best auto-complete for php of any free IDE. Zend Studio for Eclipse is a lot better, but it is expensive. Zend's Debugger is also better than even the new PDT.
Apparently this is a common problem. Based on this thread I tried netbeans (OpenSource) and phpStorm ($$$) and I must admit that they both provide better code completion.
I'm guessing there is just something buggy in the PDT build for the time being that stops auto-complete from working at times. I'll have to wait a little while and come back to using it I guess.