PHP  
downloads | documentation | faq | getting help | | php.net sites | links 
search for in the  
previousPHP and COMVon PHP 2 auf PHP 3 umsteigennext
Last updated: Sun, 09 Jun 2002
view this page in Plain HTML | English | Brazilian Portuguese | Czech | Dutch | Finnish | French | Hungarian | Italian | Japanese | Korean | Polish | Romanian | Russian | Spanish | Turkish

Kapitel 53. PHP und andere Sprachen

PHP ist die beste Sprache f�r Webanwendungen, aber was ist mit anderen Sprachen?

1. PHP vs. ASP?
2. Gibt es ein Programm, was ASP in PHP konvertieren kann?
3. PHP vs. Cold Fusion?
4. PHP vs. Perl?

1. PHP vs. ASP?

ASP ist eigentlich keine Sprache ansich, es ist ein Akronym f�r Active Server Pages, die eigentlichen Sprachen in denen ASP programmiert wird sind Visual Basic Script oder JScript. Der gr��te Nachteil von ASP ist, da� es ein propriet�res System ist und nativ nur auf Microsofts Internet Information Server (IIS) verwendet werden kann. Dies limitiert ASP auf Win32 basierende Server. Es gibt einige Projekte, die die M�glichkeit bieten, ASP unter anderen Umgebungen zu verwenden: von (kommerziell), von (kommerziell) und (kostenlos). ASP wird nachgesagt, da� es eine langsamere und schwerf�lligere Sprache als PHP ist, instabiler noch dazu. Eines der Vorteile von ASP ist, da� es, weil VBScript verwendet wird, relativ leicht zu erlernen ist, wenn Sie bereits Visual Basic programmieren k�nnen. Auch ist die ASP-Unterst�tzung im IIS Server standardm��ig vorhanden, was es einfach macht, ASP zum laufen zu kriegen. Der Umfang von ASP ist allerdings sehr limitiert. Wenn Sie also "fortgeschrittene" Features wie die Verbindung zu FTP-Servern nutzen wollen, m�ssen Sie kommerzielle Komponenten hinzukaufen.

2. Gibt es ein Programm, was ASP in PHP konvertieren kann?

Ja, wird meistens als Antwort genannt.

3. PHP vs. Cold Fusion?

PHP is commonly said to be faster and more efficient for complex programming tasks and trying out new ideas. PHP is generally referred to as more stable and less resource intensive as well. Cold Fusion has better error handling, database abstraction and date parsing although database abstraction is addressed in PHP 4. Another thing that is listed as one of Cold Fusion's strengths is its excellent search engine, but it has been mentioned that a search engine is not something that should be included in a web scripting language. PHP runs on almost every platform there is; Cold Fusion is only available on Win32, Solaris, Linux and HP/UX. Cold Fusion has a good IDE and is generally easier to get started with, whereas PHP initially requires more programming knowledge. Cold Fusion is designed with non-programmers in mind, while PHP is focused on programmers.

A great summary by Michael J Sheldon on this topic has been posted to the PHP mailing list. A copy can be found .

4. PHP vs. Perl?

The biggest advantage of PHP over Perl is that PHP was designed for scripting for the web where Perl was designed to do a lot more and can because of this get very complicated. The flexibility / complexity of Perl makes it easier to write code that another author / coder has a hard time reading. PHP has a less confusing and stricter format without losing flexibility. PHP is easier to integrate into existing HTML than Perl. PHP has pretty much all the 'good' functionality of Perl: constructs, syntax and so on, without making it as complicated as Perl can be. Perl is a very tried and true language, it's been around since the late eighties, but PHP is maturing very quickly.

User Contributed Notes
PHP und andere Sprachen
add a note about notes

29-Jul-2001 10:44

ASP rely on a scripting engine which out-of-the-box support VBScript and
JScript (MS version of JavaScript). Support for other languages (ie Perl)
is available throught add-on modules.


29-Aug-2001 09:45

Actually, ASP isn't as terrible as one might think, if you have a
background in Javascript (or other object-based languages with
dot-notation (object.object.function()). VBScript is a pain, true (cuz it
looks, feels, and smells of VB), but JScript is a lot nicer and
syntactically looks like Javascript with extra functions added for
server-side stuff (ie., file i/o) that Javascript can't do client-side. 

And while most of the code samples on the net and documentation talks
about VBScript, JScript docs and manuals can be found on M$'s sites in a
few places.

Where VBScript has that painful

IF ...
ENDIF

crap, JScript has the friendly

if () {
 // ...
}

and even

for (indexVar in ArrayName) {
  // ...
}

stuff, very much like PHP's foreach() looping. 

Once you get around the bulky object syntax for opening, closing, writing,
appending files/folders, it's not too bad. Good regExp handling, too. And
translating from PHP to ASP and back again is a good programmatic exercise
for those trying to stay grounded in object (Javascript/Jscript) and
function (PHP) notation differences. 

eg., preg_replace("/pattern/","replacement",$source);
becomes source.replace(/pattern,"replacement");
etc.

For examples of code workarounds I've built to translate PHP functionality
to ASP and vice versa (like translating PHP's file() into ASP), check out:
 and 

- [email protected]


15-Sep-2001 01:33

My last project requires VRML - IRC interaction ( if a user logs into an
irc server a proper VRML object appears in web ... ), and i found that PHP
is quite powerfull in that area as it gives the functionality to use very
customizable templates to create .wrl files. It also gives very good irc
analyzing to properly deliver parameters to VRML environment. And i think
that PHP is a real JAVA competitor in that area. But there is still a lot
of work to be done for PHP-VRML(-IRC) collaboration.


01-Feb-2002 03:24

What about PHP vs. JSP?
One of the problems I see in PHP is lack to support some design pattern
practices like MVC.
Yes it support the use of Java classes... but how good is this support?
Can use PHP as an EJB client (COM sucks because is Win32 only) 
There is any equivalent to taglibraries or the Struts framework ()
in PHP?
In favor of PHP... is really fast!, and easy to learn, ideal for
small/medium websites...but (I think) not so good for enterprise web based
applications.


01-Feb-2002 03:34

One other thing that should be mentioned about ASP vs. PHP is session
support.  I find ASPs session management to be much simpler and more
intuitive.  For example, if I want to get and set a variable, I do this:

Session("myVar") = "bob"
strBlah = Session("myVar")

In addition, Session variables stay around through the entire session
(until the user closes the browser), so there is no need for
session_start() at the beginning of each page.

That being said, I rather like PHP more syntactically and functionally. 
The C-like syntax is much easier for me to read and write, and the native
functions it supports is... extensive to say the least.

Still, ASP has better session management.

nobody
03-Feb-2002 03:31

I disagree with [email protected] who mentioned that ASP's session is
easier to use.

PHP's session management is as easy too!
to set and get a session var (similar to pyranf's example):

$_SESSION['myVar'] = "bob";
$strBlah = $_SESSION['myVar'];

what do u think?


02-Mar-2002 08:02

PHP is infact very powerful than ASP maybee because PHP doesn't require
add-ons, The only problem i have met converting to PHP
This problem is PHP's poor support for XML and XMLDOM...if this support is
available it's more diffcult to parse XML files in PHP than ASP...and as i
see XML is THE FUTURE.

if you have any information concerning PHP/XML parsing please E-maill me,


04-Mar-2002 02:34

If you ever tried to configure a web server for WAP, serving WML content
you know it's not an easy job. You can easily make dynamic WML pages for
mobile phone users with PHP. All the options and extras from DB+PHP
oriented web-site can easily be transfomed into a WAP version of your
site. With a single line - Header("Content-type:
ext/vnd.wap.wml"); you can be in another "mobile" dimension
:). Take all you need ... and even more.


12-Mar-2002 11:32

Cold Fusion vs. PHP:
What about the price?  I started a few years back designing web
applications in CF with its powerful database interfacing.  Convincing
management to spend the money on the CF server & my app can be VERY
difficult.  I have since switched ALL my apps to PHP.  I haven't come
accross a situation it couldn't handle (granted, with a decent amount of
time spent in some cases).  The savings and 'sellability' well make up for
slight difficulties I've had to deal with.

BB, FFASpector


25-Apr-2002 05:41

note to the previous comment - about the WAP and WML.
i have type'o - the right header() is :
header("Content-type: text/vnd.wap.wml");
but i wrote :
header("Content-type: ext/vnd.wap.wml");
without the "t"


18-Jun-2002 04:29

Will PHP support Application variables as in ASP? I hope so because ASP's
Application variables with the global.asa is a powerful feature.

/Peter


20-Jun-2002 04:35

What about ASP.NET?  Programming using C# in .NET, has the same syntax as
C++.  It is also much faster then ASP due to the fact that it is compiled.
 How does ASP.NET stack up to PHP?


27-Jun-2002 11:00

Well, about PHP and .NET.... I saw an article about using the COM structure
for wrapping around .NET's architecture.


index.asp?product_id=
%7BD52A041D-4FCB-44C9-BE8C-
E2D446D3A999%7D&null

(sorry for cutting, otherwise it wouldn't let me submitting the text.... =
( )

Looks very odd and complicated, but as always... People who are using or
even developing for PHP come up with solutions for any kind of much used
technology. So just wait and see (PHP with Zend 2.+) and .NET will be
supported by PHP very soon, just because Open Source is as flexible as
where the main stream wants to go.


27-Jun-2002 11:11

Oh, BTW the other comment just posted should include mentioning that the
article about PHP and .NET is also about C Sharp (C#) or VB. As long as
the modules/libraries created for .NET are build with the instructions on
that page they should be accessable within COM after the wrapping. That's
what the article is telling me, haven't tried it myself yet, but will
start with C# soon to have a look at it. If it is easy/simple, this would
mean a lot of power behind PHP coming our way. And if I'am not wrong even
on Linux (GTK#) the whole bunch of new tech will give us kick-ass power.

add a note about notes
previousPHP and COMVon PHP 2 auf PHP 3 umsteigennext
Last updated: Sun, 09 Jun 2002
show source | credits | stats | mirror sites:  
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Sat Jun 29 12:03:35 2002 CEST