PHP IDE compiling code on the fly similar to java - php

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.

Related

NetBeans: PHP Syntax Checking

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.

How a framework development works without a debugger?

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.

PHP IDE to suit my needs for Win 7

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!

PHP Lexical and Syntax analyzer written in C/C++

I'm writing a PHP IDE in Qt4 for my Master's project. I am trying to duplicate a lot of the functionality of Eclipse or Visual Studio without all the bloat and the overhead. I'm trying to do some code completion but I need to do some syntax analyzing to have intelligent code completion. I've looked at the PHP source code and thought about just compiling the Zend engine in my code (and give credit where credit is due), but even after staring at the code for a couple of days I'm not sure where to start with that.
Does anyone know some C++ code that already accomplishes this, or have used the Zend engine for their own purposes, or have some advice about writing my own?
PHP does not have anything even remotely close to a formal LALR(1) or LL(k) grammar that you could use to implement this in a manner suitable for academia. Zend's parser is not context-aware and is full of ad-hoc disambiguations from what I've seen.
That is not to say you cannot write something that does simple syntax highlighting. Take for example this javascript implementation. The code for their tokenizer is here and an active thread about the project is here.

What is the best IDE for PHP? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I'm a PHP developer and now I use Notepad++ for code editing, but lately I've been searching for an IDE to ease my work.
I've looked into Eclipse, Aptana Studio and several others, but I'm not really decided, they all look nice enough but a bit complicated. I'm sure it'll all get easy once I get used to it, but I don't want to waste my time.
This is what I'm looking for:
FTP support
Code highlight
SVN support would be great
Ruby and JavaScript would be great
For PHP I would recommend PhpStorm.
It supports FTP/SFTP synchronization, integrates well with Subversion, CVS, Mercurial and even with Git. Also, it supports HTML, CSS, JavaScript and handles language-mixing well like SQL or HTML blocks inside PHP code, JSON, etc.
But if you need Ruby you can try another IDE - RubyMine with same capabilities but for Ruby.
NetBeans. Check out 7.0.1.
It supports FTP/SFTP synchronization, integrates well with Subversion, CVS, Mercurial and even with Git (with plugin). Also, it supports HTML, CSS, JavaScript, popular frameworks and more.
And its free.
Too bad no one mentioned phpDesigner. It's really the best IDE I've came across (and I believe I've tried them all).
The main pro of this one is that it's NOT Java based. This keeps the whole thing quick.
Features:
Intelligent Syntax Highlighter - automatic switch between PHP, HTML, CSS, and JavaScript depending on your position!
PHP (both version 4 and 5 are supported)
SQL (MySQL, MSSQL 2000, MSSQL 7, Ingres, Interbase 6, Oracle, Sybase)
HTML/XHTML
CSS (both version 1 and 2.1 are supported)
JavaScript
VBScript
Java
C#
Perl
Python
Ruby
Smarty
PHP:
Support for both PHP 4 and PHP 5
Code Explorer for PHP (includes, classes, extended classes, interfaces, properties, functions, constants and variables)
Code Completion (IntelliSense) for PHP - code assist as you type
Code Tip (code hint) for PHP - code assist as you type
Work with any PHP frameworks (access classes, functions, variables, etc. on the fly)
PHP object oriented programming (OOP) including nested objects
Support for PHP heredoc
Enclose strings with single- or double quotes, linefeed, carriage return or tabs
PHP server variables
PHP statement templates (if, else, then, while…)
Powerful PHP Code Beautifier with many configurations and profile support
phpDocumentor wizard
Add phpDocumentor documentation to functions and classes with one click!
phpDocumentor tags
Comment or uncomment with one click!
Jump to any declaration with filtering by classes, interfaces, functions, variables or constants
Debug (PHP):
Debug with Xdebug
Breakpoints
Step by step debugging
Step into
Step over
Run to cursor
Run until return
Call stack
Watches
Context variables
Evaluate
Profiling
Multiple sessions
Evaluation tip
Catch errors
Are you sure you're looking for an IDE? The features you're describing, along with the impression of being too complicated that you got from e.g. Aptana, suggest that perhaps all you really want is a good editor with syntax highlighting and integration with some common workflow tools. For this, there are tons of options.
I've used jEdit on several platforms successfully, and that alone puts it above most of the rest (many of the IDEs are cross-platform too, but Aptana and anything Eclipse-based is going to be pretty heavy-weight, if full-featured). jEdit has ready-made plugins for everything on your list, and syntax highlighting for a wide range of languages. You can also bring up a shell in the bottom of your window, invoke scripts from within the editor, and so forth. It's not perfect (the UI is better than most Java UIs, but not perfect yet I don't think), but I've had good luck with it, and it'll be a hell of a lot simpler than Aptana/Eclipse.
That said, I do like Aptana quite a bit for web development, it does a lot of the grunt work for you once you're over the learning curve.
Eclipse PDT is very nice.
I'm always amazed that more people don't use ActiveState Komodo.
It has the best debugging facilities of any PHP IDE I have tried, is a very mature product and has more useful features than you can shake a stick at. Of note, it has a fantastic HTTP inspector, Javascript debugger and Regular Expression Toolkit. You can get it so that it steps through your PHP, then you see your Javascript running, and then see your HTTP traffic going out over the wire!
It also comes in free (Komodo Edit) and open (OpenKomodo versions).
Oh, and if you don't always hack just on PHP, it's designed as a multi-language editor and rocks for Ruby and Python too.
I've been a happy customer for around 5 years.
There's no "best" IDE, only better and worse ones.
Right now I'm trying to settle in with Aptana. It has a lot of cruft that I don't want, like "Jaxer" doodads all over the place. It's reasonably fast, but chokes on large files when syntax highliting is on. I have not been able to figure out how to set up PHP debugging. Three good things about Aptana: easy plugin installations, very fast and intuitive Subversion plugins, ligning fast file search.
I tried Eclipse PDT and Zend for Eclipse, but they have nightmare levels of interface cruft. Installing plugins is a living horror of version mismatches and cryptic error messages.
I also use Komodo (they bought us licenses at work). Komodo has a very intuitive interface, but is ridiculously slow, chokes on medium sized files with syntax highlighting. File search is intuitive, but rather slow. Subversion integration is not that great - slow and buggy. If not for slowness, I would have probably stuck with Komodo, especially for the debugger.
To get you started, here is a list of PHP Editors (Wikipedia).
For PHP in particular, PHPEdit is the best, and I tried and worked in some of them including, Dreamweaver, Elipse, Emacs, Notepad++, NetBeans, UltraEdit ...
Geany is a great lightweight editor -- like Notepad++ for Linux, only better. I find this, combined with a few shell scripts and symlinks for linking modules into a web source tree, make developing on Linux easy and fun.
I love JetBrains IDEs. For PHP it is JetBrains PHPStorm.
http://www.ibm.com/developerworks/opensource/library/os-php-ide/index.html
Personally, I love Notepad++... :D . The above link compares some of the better IDEs and the best ones aren't free.
I'd recommend Komodo 4.4 though (I used the trial version) since it was awesome. Better than Notepad++, but not free... :(
I would recommend Zend IDE for the integrated debugger.
I'm using Zend Studio. It has decent syntax highlighting, code completion and such. But the best part is that you can debug PHP code, either with a standalone PHP interpreter, or even on a live web server as you "browse" along your pages. You get the usual Visual Studio keys, breakpoints, watches and call stack, which is almost indispensable for bug hunting. No more "alert()"-cluttered debugged source code :)
Have you looked at Delphi for PHP (<http://www.codegear.com/products/delphi/php>) ?
Joe Stagner of Microsoft really likes Delphi for PHP.
He says it here: "[Delphi for PHP] 2.0 is the REAL DEAL and I LOVE IT !"
Eclipse with PDT.
I use and like Rapid PHP.
What features of an IDE do you want? Integrated build engine? Debugger? Code highlighting? IntelliSense? Project management? Configuration management? Testing tools? Except for code highlighting, none of these are in your requirements.
So my suggestion is to use an editor that supports plugins, like Notepad++ (which you are already used to). If there's not already a plugin that does what you want, then write one.
I use Coda on Mac OS X.
There is a new guy in town, PhpStorm from JetBrains. You use it and I bet you will forget all the other editors. It's bit pricey though, unfortunately.
RadPHP (previously known as Delphi for PHP) is the best.
All are good, but only Delphi for PHP (RadPHP 3.0) has a designer, drag and drop controls, GUI editeor, huge set of components including Zend Framework, Facebook, database, etc. components. It is the best in town.
RadPHP is the best of all; It has all the features the others have. Its designer is the best of all. You can design your page just like Dreamweaver (more than Dreamweaver).
If you use RadPHP you will feel like using ASP.NET with Visual Studio (but the language is PHP).
It's too bad only a few know about this.
Aptana supports this and I use it for all of my web development now.
Hands down the best IDE for PHP is NuSphere PHPEd. It's a no contest. It is so good that I use WINE to run it on my Mac. PHPEd has an awesome debugger built into it that can be used with their local webserver (totally automatic) or you can just install the dbg module for XAMPP or any other Apache you want to run.
The best IDE for PHP in my opinion is Zend Studio (which itself is based on Eclipse PDT). Note that in this case "best" does not necessarily mean "good." It is slow and a bit buggy, but even so, it's still the best option for PHP programmers. I've tried a ton of PHP editors over the years and I haven't yet found one that works great.
Komodo IDE would be my second choice. My only problem with Komodo is that the autocomplete is not as good. With properly structured apps where you use phpDoc to document return types etc., it should be alright. But I work on a project that doesn't really do that and Komodo can't read across files to know that $user is a User object for example.
Personally everything that is based uppon Eclipse or NetBeans is an overkill, the GUI is crap and the performance is soooo slow compared to other alternatives.
If you're willing to pay I would suggest Zend IDE (version 5.5, not 6 because it's based on Eclipse) and EditPlus for a more lightweight yet powerfull code editor.
If you're looking for free alternatives, or if you code in other languages other than PHP, OpenKomodo is a really nice IDE with almost all the features (no SVN neither CVS) that you require, the only con I see about OpenKomodo is that sometimes it messes my code indentation, but then again I don't use it on a very regular basis.
As for a free lightweight alternative: Notepad++. =)
My personal preference is Eclipse (with various plug-ins) as I am developing in several languages (PHP, Java, and Ruby) and this way I am always used to interface and keyboard shortcuts. This is not a minor thing as you become very productive this way.
I haven't used Aptana, but will (hopefully) soon - it does look interesting, though.
For others IDEs I have used: jEdit (for little Java), Notepad++ (still for some scripting and short test code runs).
And for the features You asked: Eclipse support many source code version servers (Subclipse); your project can be on a Samba share; ZendDebugger/xdebug for debugging.
I've tried Eclipse PDT, with some success. Aptana is also pretty good, or if you are doing a lot of AJAX stuff, it's great. Your mileage may vary, however, depending on what additional plugins you want to use with them.
PHPEclipse is as close to Eclipse java power as it could get. Eclipse PDT is much weaker (last time I checked).
I'm using PHPDesigner but I will go for Eclipse PDT. I was always against Eclipse until few months ago when I have one Java project to finish... Great IDE
Now I can't imagine one day without Eclipse. :)
Have you tried NetBeans 6? Zend Studio and NetBeans 6 are the best IDEs with PHP support you'll come across and NetBeans is free.

Categories