tags:

views:

288

answers:

9

Hello,

I've tried asp.net and jsp...and the programming language was powerful enough to create both desktop and Windows apps.

Butwhat can I possibly do with php other than creating web applications? Does it have some kind of runtime or framework?

Thanks

+15  A: 

Powerful is an unfortunate word. It's about focus, not power. PHP is not very well suited for desktop applications. In part because of weak library support (Though some exists), and in part because of its memory management model. It can be used for jobs outside the web world though; It's often used as a general scripting language, as well as various background tasks.

troelskn
it's indeed about focus. well said
Sander Versluys
A: 

PHP can be run via an interpreter on the command line, so any computation task can be done in PHP. I don't know about desktop apps and GUI.

boutta
+3  A: 

PHP is not "limited" per se. PHP is primarily only used to develop Web applications. However, there are products like WinBinder that promise to allow you to use PHP to build a desktop application; I wouldn't exactly recommend that though. Also, you probably have not built Windows applications with ASP.NET and JSP but rather more likely .NET WinForms and Java (perhaps Swing). PHP is used by thousands of developers building many different Web applications. It is possible to build other kinds of applications with it but again I wouldn't recommend going down that path.

BobbyShaftoe
+3  A: 

PHP was intended as a web development language, but you can write console scripts with it, and if you're feeling brave, use something like PHP-GTK to write GUI apps.

Paul Dixon
A: 

PHP has a runtime but it's not fully interpreted like some languages. For example, you can't redefine a method. As far as desktop apps, PHP has bindings for creating desktop apps but it's not very good. It's great for command line tools. Zend and CakePHP are two frameworks for web apps. PHP is like a very-easy to use version of C with a very good community of extensions (look at the extensions on php.net docs). PHP is well supported on windows (even by Msft).

nessence
A: 

Quite often it is the "limitation" or for want of a better word "focus" of a language that makes it powerful rather than weak.

Robin Day
A: 

I'd say PHP is best suited for web application development. It does the job, and does it well.

But that's not to say that it is not useful for anything else. It can be used as a generic scripting language.

With Qt, you can even develop desktop apps using PHP. Check out http://php-qt.org/

But the focus must be with web apps: PHP was intended for the web.

Here Be Wolves
+2  A: 

PHP makes a surprisingly good shell scripting tool. It has a wealth of simple functions built in.

While you can do the same thing in JSP and C# you will spend a lot more time vs. any scripting langauge.

The biggest advantage PHP has over other scripting languages is PHP.net Documentation. Out of any language I have ever used this single resource defines what good documentation and organization of a langauge reference should be.

gradbot
Yeah, for all the weird broken parts of PHP, the online documentation is fantastically easy to use.
postfuturist
A: 

Depends on what you consider powerful? It is designed for server-side web-development, and it does that perfectly.

I can't see myself saying one language is more powerful than the other, as it is always a matter of preference, the task at hand and whether the language was designed for what you are trying to accomplish.

Dmitri Farkov