Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

A Decade of PHP

Zonk posted more than 9 years ago | from the i'll-bring-the-cake dept.

PHP 452

digidave writes "It was slow to catch and a lot of people didn't get it. A lot of people still don't get it, but you can't argue with its success. June 8th, 2005 marks the tenth anniversary of PHP. Here's to ten more wonderful and exciting years."

Sorry! There are no comments related to the filter you selected.

Congratulations are in order! (3, Insightful)

AKAImBatman (238306) | more than 9 years ago | (#12768485)

Congrats to the PHP development team! PHP has long followed the KISS principle while still maintaining the Unix APIs that we've all learned to know and love. While it's not the best web scripting platform for all purposes, it is a free and flexible alternative for many, many dynamic webpage projects. It's only because of PHP that so many OSS web applications have been allowed to exist.

It was slow to catch and a lot of people didn't get it.

Ok, I'm with the slow-to-catch-on part, but what's this about people not getting it? The concept had to be one of the simplest ever designed. (Thus the reason why it's so common across web scripting languages.) Here is your HTML, here's a bit of Unix scripting langauge. Simple, see? :-)

On a slightly different topic, one wishlist item that I would like to see in PHP is Abstract Database Access. It's not really a good thing to hard code your application to a specific database, especially if it's a redistributable application. (e.g. PHPBB) The ODBC calls sort of solve this, but they do require that ODBC is installed, properly configured, and compiled into your copy of PHP. (Does anyone know if any distros now have ODBC as a "standard" library?) This assumption can't be made for most OSS applications, so they tend to tell you to just use MySQL.

Re:Congratulations are in order! (5, Informative)

quinto2000 (211211) | more than 9 years ago | (#12768509)

there are several classes, including the PEAR DB class, that provide a DB abstraction layer.

Re:Congratulations are in order! (5, Informative)

AKAImBatman (238306) | more than 9 years ago | (#12768610)

Dude, you need to provide links. I had to *gasp* Google it! ;-)

For others, PEAR can be found here:

PEAR Class Repository [php.net]

The Database classes of PEAR appear to be documented here:

Database Package [php.net]

Looking over the DB classes, it looks like they provide a fairly decent abstraction. Thanks Quinto, that will definitely be nice for future PHP projects. :-)

Re:Congratulations are in order! (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#12768556)

If the "KISS principle" results in PHP-like code, I say we kiss the KISS principle goodbye.

Re:Congratulations are in order! (2, Funny)

Ford Prefect (8777) | more than 9 years ago | (#12768597)

On a slightly different topic, one wishlist item that I would like to see in PHP is Abstract Database Access.

Actually, what I'd like to see is bitwise-operations on strings - my Ogg Vorbis decoder written in PHP is currently languishing at just a bare-bones Ogg demuxer 'cos unpacking all the Vorbis packets proved just too fiddly...

Re:Congratulations are in order! (4, Insightful)

AKAImBatman (238306) | more than 9 years ago | (#12768663)

You wrote an OGG Vorbis decoder in PHP? Maybe I'm missing something, but why? That doesn't strike me as a very good language to be doing such a thing in. The "PHP Way" is to leave heavy processing like that to an external library such as libogg/libvorbis. You can then use PHP as a frontend for presenting info, streaming the data, and uploading files.

I realize that PHP can be cool at times, but one has to use the right tool for the job at hand. :-)

Re:Congratulations are in order! (1)

Ford Prefect (8777) | more than 9 years ago | (#12768769)

I realize that PHP can be cool at times, but one has to use the right tool for the job at hand. :-)

That was precisely the reason I chose PHP - because it was absolutely the wrong tool for the job.

Well, maybe not quite as bad as some. Anyone want a port to Javascript? BBC Basic? Befunge? ;-)

Re:Congratulations are in order! (1)

compm375 (847701) | more than 9 years ago | (#12768913)

Wait, so you chose the wrong tool on purpose and now you are complaining that it doesn't have what you need?

Re:Congratulations are in order! (1)

bhtooefr (649901) | more than 9 years ago | (#12768961)

RPG IV? (Is that even POSSIBLE, seeing as sound output on an AS/400 terminal consists of beeps (IIRC)? Of course, WAV output could be done, but RPG aims for a printer - not even a screen)

Re:Congratulations are in order! (2, Insightful)

EraserMouseMan (847479) | more than 9 years ago | (#12768622)

It's not really a good thing to hard code your application to a specific database

For most simple apps (90% of what PHP apps are) you should stick with SQL-92 syntax when you write your queries. Then just write yourself some generic functions that you pass your query and a connection string to. The functions determine the db-specific query execution code to use. I always use parameterized queries. So I've even got functions to switch the parameter character ('?' or '@' etc) to the syntax of the target db. For my apps, all I have to do is change the connection string (currently supports, MySql, Sql Server, any Odbc and any OleDb). No query or code changes required necessary.

But yea, it'd be nice if this functionality was native.

Re:Congratulations are in order! (3, Interesting)

AKAImBatman (238306) | more than 9 years ago | (#12768690)

I completely agree. The primary reason why native code would be nice is that a bundled API would help put peer pressure on coders to use it. Which means that we'd see fewer "quick hacks/prototypes" (that always turn into production sites) using database specific code.

Re:Congratulations are in order! (0)

Anonymous Coward | more than 9 years ago | (#12768842)

And then you want to get the ID of the row you just entered into the database.

Re:Congratulations are in order! (1)

The Irish Jew (690798) | more than 9 years ago | (#12768671)

On a slightly different topic, one wishlist item that I would like to see in PHP is Abstract Database Access. It's not really a good thing to hard code your application to a specific database, especially if it's a redistributable application. (e.g. PHPBB) The ODBC calls sort of solve this, but they do require that ODBC is installed, properly configured, and compiled into your copy of PHP.
I've found ADOdb [sourceforge.net] to be a very easy way of abstracting your database. Much easier than Pear::DB. Supports just about every database you can think of.

Re:Congratulations are in order! (4, Interesting)

rho (6063) | more than 9 years ago | (#12768678)

I've never understood the fanaticism of database abstraction. There's good reason to hardcode to a specific database, especially if you hardcode to a Free database like PostgreSQL.

For example, if you use a database abstraction, you have to make a lot of performace- or feature-robbing choices. There are still hosting situations where MySQL is still on 3.23, so you can't use the better parts of the InnoDB storage engine. So no foreign key constraints, no stored procedures.

On the other hand, if you do hardcode for PostgreSQL, you put a burden on the end user, sure--but in return, you're giving them a more robust, more featureful application that is easier to support and maintain. I personally like PostgreSQL because it seems less haphazard than MySQL, but you could very easily do this with MySQL, so long as you restrict yourself to the later, non-crippled versions.

The Arsdigita folks did this with Oracle. Leaning on a $tens-of-thousands database application may put you out of the realm of everyday developers, but it's far from insane.

This is "all the time I've spent dealing with other people's code that doesn't have a foreign key to be found and all integrity checking is done in the PHP code" talking. It's infuriating.

Re:Congratulations are in order! (2, Informative)

AKAImBatman (238306) | more than 9 years ago | (#12768881)

You can easily code your SQL to be database specific if you need it that way, but that shouldn't in any way stop developers from using a generic DB access API. A DB abstraction is nothing more than a mapping of functions, so there's rarely any performance hits. Which means that applications that don't need a specific database (e.g. PHPBB anyone?) could be portable out of the gate. And even if their SQL isn't portable, that's a far easier thing to fix than attempting to add a DB abstraction after the fact.

Database independence (2, Insightful)

3770 (560838) | more than 9 years ago | (#12768939)

I support the idea of database independence.

But it should be done by using standard SQL.

Unfortunately, that is not a losing battle, it is a lost battle.

The database vendors doesn't care about standard SQL.

Re:Congratulations are in order! (2, Insightful)

mcrbids (148650) | more than 9 years ago | (#12768984)

Hear here!

I've never understood the fanaticism of database abstraction. There's good reason to hardcode to a specific database, especially if you hardcode to a Free database like PostgreSQL.

You took the words right outta my mouth. I tend to work on large projects, usually the app has its own server (or servers) to work on.

I've hard-coded to Postgres since 7.0 came out, and I've NEVER regretted it. The only problem I've had is when one of my clients demanded "cross-platform".

I had more problems with that sucker than with three others combined. Since I couldn't assume subselects, there was lots of parsed queries that resulted in additional bugs, etc.

Pick a platform, then use it. If the platform is truly free, you aren't "locking" anybody at all, are you?

PHP definitely does not follow the KISS principle (5, Informative)

Peter Cooper (660482) | more than 9 years ago | (#12768679)

PHP has long followed the KISS principle

Are you smoking crack? PHP is more inconsistent than any other language I've encountered. I'm not disrespecting the team, as I'm sure they've worked hard, and it's great to celebrate ten years of an admittedly very useful language, but PHP is not an inherently easy language.. it's just one that lets you code sloppily and get away with it.

For a start, PHP functions seem to have no consistency at all. Sometimes you get verb/object, sometimes object/verb. Sometimes you get underscores, sometimes you don't. Consider.. is_object but isset. str_rot13 but strpos. php_uname but phpversion. There are hundreds of these. It's the reason I could never learn PHP, it's like learning Chinese, but I found Perl (and now Ruby) easy due to their relative consistency. Sometimes PHP uses "to", sometimes it uses "2".. huh what's that about?

Unlike Perl which has a few regular expression constructions and a handful of modifiers.. PHP has a whole glut of regular expression functions which have confusing names, some of which take certain modifiers, and some that don't. As someone who has mastered Perl's regular expressions I find it a major struggle when I have to tackle something in PHP (I admit, I've never 'learned' PHP, but I find it a very hard language to make quick fixes on for other people.. compared to, say, C, VB or Python, languages I don't know intimately but can easily hack).

PHP has thousands of core functions.. nuts! And why does PHP have such a bizarre lack of abstraction? PHP often has about 10 functions compared to other languages' single function.. with each of the 10 doing a slightly different thing. When it comes to being overly wordy and inconsistent, I doubt anything can beat PHP, but, well, I'd like to see someone bring up a language that is!

So if you were going to call any language "KISS", it'd be Ruby or Python.. but PHP? No way.

Re:PHP definitely does not follow the KISS princip (1)

AKAImBatman (238306) | more than 9 years ago | (#12768794)

Are you smoking crack? PHP is more inconsistent than any other language I've encountered.

Nope, I'm just a realist. PHP was designed to be a web scripting language that wrapped Unix APIs. Nothing more, nothing less. I in no way agree with the fanaticism surrounding PHP (it doesn't make a good general purpose language people!), but it does what it was designed for in a straightforward, simplistic fashion. I usually prefer to do things in JSP/Java, but if it's not an option for some reason then I prefer to use PHP over any other option. Especially over ColdFusion.

In the past two days, I have run across two separate CFM sites that crashed nonstop on simple operations. On one site, the exact same data entry would crash the first few times, then mystically work correctly. I know that a lot of people like CFM for its "simplicity", but it just doesn't cut the mustard for robust and reliable web code.

Re:PHP definitely does not follow the KISS princip (2, Insightful)

Peter Cooper (660482) | more than 9 years ago | (#12768831)

Aha, I was looking for a worse language than PHP and I think we've found it. ColdFusion! How could I forget about that nugget of programming fools' gold ;-)

I would agree that PHP makes a decent web scripting language for basic tasks (polls, counter, guest book, a bit of remote inclusion), but I am horrified to see people actually using it for serious stuff like enterprise level systems. That sort of stuff makes the blood freeze. I feel really sorry for the corporations who get sucked into it.

Re:PHP definitely does not follow the KISS princip (1, Insightful)

fbjon (692006) | more than 9 years ago | (#12768947)

But on the toher hand, PHP isn't really ciplled in any way, is it? Sure the function names are varying, but that can be fixed eventually. It's just easy to do things right there on the spot, instead of doing it really elegantly, but if you force yourself to do things the right way, wouldn't PHP be as good as any other option?

Enterprise level systems (1)

ylikone (589264) | more than 9 years ago | (#12768962)

Well, I program enterprise level web apps using PHP all day long. And I get paid good money to do it. I have a Bachelors degree in Computer Science and am not a complete programming newbie... and I think there is nothing wrong with PHP for enterprise apps. I suspect you are just being elitist... whatever... get over it. PHP is here to stay.

Re:PHP definitely does not follow the KISS princip (2, Insightful)

lawpoop (604919) | more than 9 years ago | (#12768956)

I agree with the simple inconsistencies. What annoyts -- no, frustrates -- me most is that the functions that have a string and an array for an argument is that sometimes the array comes first, and sometimes the other argument comes first. I hate it.

Re:Congratulations are in order! (1)

dchaos (91787) | more than 9 years ago | (#12768725)

Another db abstraction layer you might want to look into is Creole.
It's built for PHP5 but there is also a php4 back port made to support another project.

I've been using it for a little while and really like what I see.
http://creole.phpdb.org/wiki/ [phpdb.org]

Re:Congratulations are in order! (1)

kjh1 (65671) | more than 9 years ago | (#12768744)

Hear! Hear! Thx Rasmus. I still remember one of my co-workers first encouraging me to use PHP for CGI scripting about 5 years ago, and me saying "Nah, Perl works a-ok for me." Well I also used the Bourne Shell for CGI scripting once upon a time too and moved along.

PHP really is the right tool for the job of building websites. It was designed with that in mind, so that's not a slam against Perl in any way.

To be fair, I should really check out Python and Ruby soon... The great thing about PHP now is that it has reached that critical mass where the numbers in users, libraries and tools are large enough to help you with almost anything. So there is that inertia keeping me, and I'm sure many others, from moving onto, or even trying some other language.

Here's hoping for another 10 years...

Re:Congratulations are in order! (1)

Jack9 (11421) | more than 9 years ago | (#12768827)

In 1999 when I first started gathering talent for a web hosting company (in lieu of a PHP position, which I found a month later), I met set a meeting with a programmer named...John in a San Jose Embassy Suites. Upon hearing, the important detail; we would be using PHP in lieu of Perl, he promptly called me crazy and informed me he wouldn't be wasting his time considering working with someone who was trying to use PHP(PHP/FI at the time). Nice not working with ya John.

What's not to get? (2, Insightful)

Enigma_Man (756516) | more than 9 years ago | (#12768492)

Seriously, honest question. What's not to get about a language? It's just another language with different options, styles, formats, and uses...

-Jesse

Re:What's not to get? (1)

i.r.id10t (595143) | more than 9 years ago | (#12768553)

Shouldn't your sig be "CLOAD" and not "LOAD" ? I have my TRS-80 manuals here on my desk if you need a new reference....

Re:What's not to get? (1)

clifyt (11768) | more than 9 years ago | (#12768603)

Looks like perfectly good Vic20/C64/C128 loading to me :-)

Then again, it could be that old Tandy / Commodore rivalry I always saw in the old computer users groups of the 80s. Don't worry, we always kick your Trash-80 asses.

Re:What's not to get? (1)

Enigma_Man (756516) | more than 9 years ago | (#12768661)

Couldn't the trash-80's set themselves on fire? :)

-Jesse, still uses his C-64 on occasion.

Re:What's not to get? (1)

i.r.id10t (595143) | more than 9 years ago | (#12768895)

Well, as long as we are going way OT, I have a Commodore CP/M kit here on my shelf as well.

Do these antiquities have any value?

Re:What's not to get? (1)

urmensch (314385) | more than 9 years ago | (#12768613)

Perhaps I'm ignorant, but isn't LOAD for C64?

Re:What's not to get? (0)

Anonymous Coward | more than 9 years ago | (#12768621)

Don't mess with the C-64 crew.

Re:What's not to get? (1)

chill (34294) | more than 9 years ago | (#12768871)

Shouldn't your sig be "CLOAD" and not "LOAD" ? I have my TRS-80 manuals here on my desk if you need a new reference....

The C-64, and probably VIC-20, versions were LOAD "*",8,1 for the attached disk drive.

-Charles

Re:What's not to get? (0)

Anonymous Coward | more than 9 years ago | (#12768576)

PHP is unique. It has highly advanced rooting and worm features. [secunia.com]

Re:What's not to get? (1)

Skater (41976) | more than 9 years ago | (#12768605)

REGISTER_GLOBALS is one thing to "get". Why was that turned on by default in earlier versions? Everything I wrote before they changed that option requires it to be on because I wasn't aware of the security implications. Nothing I've written that way is on the web anywhere, so it's not doing anyone any harm, and I've learned more about security since then - but what about PHP coders that have released code requiring it to be on? Having REGISTER_GLOBALS set "off" right from the start would've saved a lot of headaches, because it would've helped force better programming technique and maybe even better data validation.

Re:What's not to get? (1)

markild (862998) | more than 9 years ago | (#12768702)

I had the exact same problem when they released the first version without the register_globals being set to on as default. I think it was like 4.1 or something.

Anyways, it was then I discovered that it might be a good idea to read the readme files, and security threats. They had long been aware of the threats that it posed to have the option turned on, and they had warned us. The same thing goes for a lot of the big changes from php4 to php5 as well.

Re:What's not to get? (2, Informative)

ajs318 (655362) | more than 9 years ago | (#12768941)

REGISTER_GLOBALS is not insecure. The default order of fetching -- cookies overwrite sessions, POSTs overwrite cookies, query strings overwrite POSTs -- is potentially insecure. Somebody could use a URL something like http://myisp.co.uk/~myspace/foo.php?auth=1 [myisp.co.uk] and, if you just relied on the value of $auth without regard to where $auth was coming from, you might get hurt.

It did say in the manual that this would happen and how to get at the different data sources if you cared. {And you can do sneaky stuff of your own, like if ($_GET["auth"]) { include "crash_browser.inc.php"; exit(); }; if you really want}.

Often, you don't really care where your data is coming from anyway. I personally would have had POSTs overwrite query strings, cookies overwrite POSTs and sessions overwrite cookies. That would have dealt with it even more simply -- though it probably would have made debugging a 'mare.

First AC (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#12768496)

What the hell is PHP?

Re:First AC (4, Informative)

AKAImBatman (238306) | more than 9 years ago | (#12768543)

What the hell is PHP?

Probably a troll, but just in case anyone else doesn't know: PHP is a scripting language designed for generating dynamically created web pages. It functions by mixing its scripting in with the HTML, thus allowing programmers to reuse existing page designs. The scripting APIs are centered around those commonly used on Unix systems. PHP is usually bundled with Apache, so no installation tends to be required.

PHP Homepage [php.net]

Standard practice! (1)

Grendel Drago (41496) | more than 9 years ago | (#12768591)

No, no. Standard practice is to just send them to Wikipedia [wikipedia.org] or a google search [google.com] to demonstrate that the information they seek is quite readily available, and make the original poster feel kinda dumb, while not wasting time on rewriting an intro paragraph and therefore handing a victory to a possible troll.

--grendel drago

Re:Standard practice! (1)

radja (58949) | more than 9 years ago | (#12768646)

alternatively, you may direct them here [fuckinggoogleit.com] , immediately proving your superiority and knowledge of the internet.

Re:Standard practice! (1)

OreoCookie (814421) | more than 9 years ago | (#12768875)

Maybe the questioner is looking for a little more insight than can be gotten from a Wikipedia definition. By your reasoning nearly every comment on /. is redundant. The same or better information can be found by Googling for it.

Re:First AC (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12768755)

1. Post AC

2. Answer AC's question

3. Karma!

Good for them. (4, Funny)

Willy on Wheels (889645) | more than 9 years ago | (#12768507)

I have been an avid user of php, I have even made my own website using PHP. It is so good that big sites such as mine use it. For all serious developers, PHP is the best choice for all php programming.

Re:Good for them. (1, Funny)

donnyspi (701349) | more than 9 years ago | (#12768541)

"PHP is the best choice for all php programming."

That's not saying a whole lot :-). I know what you meant though and I agree that PHP is great.

Re:Good for them. (5, Funny)

generationxyu (630468) | more than 9 years ago | (#12768550)

PHP is the best choice for all php programming.

You're absolutely right. I tried to do my PHP programming in BASIC once. Bad idea.

Re:Good for them. (1)

Enigma_Man (756516) | more than 9 years ago | (#12768724)

All you whippersnappers, I do my PHP in assembly, and I like it!

-Jesse, not really old, but do like/use assembly daily.

Re:Good for them. (1)

elrous0 (869638) | more than 9 years ago | (#12768918)

Hey anyone remember learning PHP Cobol back in school?

-Eric

Yay? (-1, Redundant)

fbartho (840012) | more than 9 years ago | (#12768524)

I mean, I don't really know what kind of comments they're looking for, PHP is cool, I love it, as a c++/c base programmer, php seemed amazing for the internet, but this is not controversial, Plus, that was yesterday... but yeah, *moves along*

I don't really like PHP that much... (3, Insightful)

Anonymous Coward | more than 9 years ago | (#12768527)

What is so exciting about it? I can't find a single situation where it is better to use PHP than other programming languages. Why would anyone love PHP?

Re:I don't really like PHP that much... (1)

Peter Cooper (660482) | more than 9 years ago | (#12768729)

It's not "exciting" but PHP is one of those languages that's successful and useful because of its marketing and "who knows who". You won't find many hosting companies that won't allow PHP scripts to be run on their servers.. whereas better languages like Python, Ruby, etc.. all have rather bad support with ISPs. The start of the problem is that most ISPs won't support FastCGI, and that's the primary way these other languages should be deployed on servers nowadays.

Re:I don't really like PHP that much... (2, Insightful)

sffubs (561863) | more than 9 years ago | (#12768772)

PHP is good because it's easy. It might often not be the most sophisticated, structured, or easily maintained language, but it is often the quickest and simplest solution to a problem. In that respect it fills an important niche.

Re:I don't really like PHP that much... (0)

Anonymous Coward | more than 9 years ago | (#12768940)

How about:

Fast, Easy, Free, not tied down to an OS.

Congratulations PHP (5, Funny)

GnuVince (623231) | more than 9 years ago | (#12768552)

You've done such a wonderful job that it's time you stop now and let something better [rubyonrails.org] take over :)

Re:Congratulations PHP (1)

Usquebaugh (230216) | more than 9 years ago | (#12768699)

Yep, but it'll take another 10 years before the peons get it.

Re:Congratulations PHP (1)

rho (6063) | more than 9 years ago | (#12768805)

Yeah, this sounds like what the PHP folks were saying about Perl something like 6 years ago. I know you were tongue in cheek, but really--isn't language bigotry a pretty old joke by now? Perl is still around; PHP will still be around; and Ruby-on-rails will still be around when SexCodeSuperFunNerds arrives to "displace" it.

Re:Congratulations PHP (1, Funny)

Anonymous Coward | more than 9 years ago | (#12768908)


thank you

we have been searching for a cool name for our project we will be springing on the net soon

awesome

thanks again

PHP vs JSP (5, Interesting)

SamSeaborn (724276) | more than 9 years ago | (#12768557)

Congrats to PHP for its success, but I'm one of those who doesn't get it.

I tried PHP, but I didn't feel it gave me the rigid OO structure and sophisticated APIs I get from Java, JSPs & Servlets.

Not trolling, just saying I'm surprised that Java and Servlet hosting isn't as popular as PHP. I'm obviously missing some key point.

Sam

Re:PHP vs JSP (5, Insightful)

Frymaster (171343) | more than 9 years ago | (#12768624)

I tried PHP, but I didn't feel it gave me the rigid OO structure and sophisticated APIs I get from Java, JSPs & Servlets.

but procedural is a valid way to structure your apps... especially for web-based ones where that have, by nature, a page-based model and a very linear flow. you can write serious software using php4 without oop!

Re:PHP vs JSP (4, Insightful)

NardofDoom (821951) | more than 9 years ago | (#12768650)

The key point you're missing is that PHP doesn't have a rigid OO structure, which is why it's popular, especially for web scripting. People don't want rigid structures if they just want to throw a page together. It also is integrated well with Apache and uses similar control functions to C/C++, so programmers can switch between the languages easily.

Re:PHP vs JSP (0)

Anonymous Coward | more than 9 years ago | (#12768675)

I suppose you don't "get" C either then.
PHP isn't supposed to be totally rigid OO, it just has OO capability if you want it.

Re:PHP vs JSP (3, Informative)

xannik (534808) | more than 9 years ago | (#12768687)

I think the main reason is that OO is just not important when writing simple scripts that are taking information say from an HTML form and inputting into a database or some other simple yet highly used task. Most people that are using PHP on a shared hosting provider will probably not need to use any OO features. Now, the PEAR project for PHP does provide good abstraction for the language and I think makes PHP a much more usable system for higher end projects. I guess what I am trying to say is that for the common joe PHP is simple and gets the job done and if there is an easy way to do something normally people will flock to that solution. And I also think that PHP as of version 5 has become a much more mature option for even high end companies.

Re:PHP vs JSP (0)

Anonymous Coward | more than 9 years ago | (#12768723)

Whilst I am not sure about the API side, I can say that PHP5 has done really well on the OO side compared to PHP4. I am really impressed with the level of thought, time and dedication gone into the making PHP5 by the entire team. Top notch.

If you have a few days take a look at PHP5, even if it only for curiosity. I did and I am glad. Well done to the developers.

Re:PHP vs JSP (1)

Chewbacon (797801) | more than 9 years ago | (#12768745)

Congrats to PHP for its success, but I'm one of those who doesn't get it. I tried PHP, but I didn't feel it gave me the rigid OO structure and sophisticated APIs I get from Java, JSPs & Servlets. Some people just can't break away from declaring and typing variables. I agree, it isn't normal and makes me feel like everything I write in PHP is sloppy, but I still get the language.

Re:PHP vs JSP (1)

FidelCatsro (861135) | more than 9 years ago | (#12768812)

You can Declare variables in PHP its not needed but you can do it $blah = 1 ; $String = " " . and you can even give them a type by doing it $floatvar = 1.1.
It's not needed as noted , but if it helps you use the language then it's easy enough to imitate it .

Re:PHP vs JSP (1)

x8 (879751) | more than 9 years ago | (#12768830)

I'm surprised that Java and Servlet hosting isn't as popular as PHP.
This is not true at least for those who choose a programming language based on employment prospects....On monster.com there are usually 2 to 6 times as many job openings for jsp than php. Any insights on what indication this might have on a language's popularity?

Re:PHP vs JSP (1)

barzok (26681) | more than 9 years ago | (#12768880)

As others have noted, you don't always need OOP. That OO exists is not a requirement that one uses it to solve every problem presented. Handling input from an HTML form and storing it to a database doesn't really need OO, does it?

Re:PHP vs JSP (1)

Kristoffer Lunden (800757) | more than 9 years ago | (#12768931)

Back in the days, say a few years ago at least, getting JSP and Servlets up and running was a pain, even if you knew and used Java already, and had it installed. And then it was a pain configuring it all. PHP, as I remember it, has always just worked, with ease. No, I don't know how the status is today, and since I don't miss Java I don't need to know. Back then this was important though.

After all that was done, well then it was up to if you liked Java or not. And I've come to realize that Java is a language you either like or not, rarely any in-betweens. I came from Java, so in order to use PHP I'd have to learn a new language, granted it is not hard - and maybe that is the point. PHP is easier. It is not guarded by a lot of "safety syntax", but really, that usually isn't needed. Java is quite powerful, but it is also very verbose and does things the long way around, or at least it did.

I still use PHP now and then, if rarely, but right now I'm looking into Catalyst [cpan.org] which seems really promising - it's inspired by Ruby on Rails and Maypole, among other things, but for Perl. I really wish there were some more examples and example applications to look at though, the documentation is pretty good (and there's always the source), but too see how it all should fit together, I'd like to see more from people already grokking it. I've been reading the mailing lists, this perl.com article [perl.com] and some other things, but that is what I am missing.

Perl has become the favourite language. It has CPAN (if Ruby had that on the same level, it'd probably be Ruby). It can do anything, and it doesn't get in your way. It also attracts lots of jokes about readability but that's just people who haven't actually made a serious try to understand.

php? (-1, Redundant)

Anonymous Coward | more than 9 years ago | (#12768558)

pretty homo programming?

PHP no thanks (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12768564)

Since when are opinions news! Oh yeah this is slashdot nevermind. The poster couldn't just say its ten years of PHP but had to bash everyone who doesn't like it. Guess what I don't like it, I tried it, still don't like it. Give me perl ASP for small stuff and servlets for larger stuff.

Thanks for the career, PHP!! (5, Insightful)

ylikone (589264) | more than 9 years ago | (#12768586)

I've made my living for the past 3 years as an independent PHP developer. I don't care what anybody thinks of PHP, it makes me money to live.

Offtopic??!! (0, Offtopic)

ylikone (589264) | more than 9 years ago | (#12768715)

Whoever moderated this offtopic, are you on crack or what? How much more ontopic do I have to be?

Re:Thanks for the career, PHP!! (0, Offtopic)

BigGerman (541312) | more than 9 years ago | (#12768786)

Offtopic? Did Slashdot add some kind of random moderation just to spice things up a bit?

Re:Thanks for the career, PHP!! (4, Insightful)

downward dog (634625) | more than 9 years ago | (#12768822)

The poster makes a valid point: PHP is a marketable language. Whether it is good or bad, perfect or not, it gets the job done for some people. Myself included. I'll give Ruby a chance someday, but for now, PHP keeps my clients happy.

Student Suspended Over Suspected Use of PHP (5, Funny)

Conspiracy_Of_Doves (236787) | more than 9 years ago | (#12768590)

Re:Student Suspended Over Suspected Use of PHP (0)

scrappy64 (824485) | more than 9 years ago | (#12768770)

High school sophomore Brett Tyson was suspended today after teachers learned he may be using PHP.

"A teacher overheard him say that he was using PHP, and as part of our Zero-Tolerance policy against drug use, he was immediately suspended. No questions asked," said Principal Clyde Thurlow.


This kid is yet another victim of the peer pressure to use PHP!

Exciting? (1)

gamlidek (459505) | more than 9 years ago | (#12768594)

Wonderful, maybe... but Exciting? C'mon! It's a development language.

I guess I'm one who still doesn't get it... /gam/

One of pillars of success: manual (5, Insightful)

Pecisk (688001) | more than 9 years ago | (#12768602)

Yes, that simple thing which is overused for learning and coding pratices. In the times when you are have to look for good perl manual, PHP manual from the very begining was perfect. That's it. And second best thing came when they added those comments for user experience.

So, in any way, PHP is such thing which just works.

Congrats! :)

Agreed - it's a great starter language (1)

cbreaker (561297) | more than 9 years ago | (#12768946)

I'm no programmer. I never have been.

But I wanted to make a really cool web site for a game group I was in, and I dug into it. I found PHP, as it worked real easy with both apache and IIS.

I ran through some tutorials (there's a ton of them out there, online, free) and I started to get into it.

The PHP manual has a lot of information and detail about nearly everything the language can do. It's a reference but it's easy to read and you can sit down with it and learn a lot about PHP and programming in general.

The truth is, PHP isn't all that much different then Javascript, Perl, etc. The syntax is very similar. Many of the functions are very similar. After creating my web site, complete with mySQL/MS-SQL support, logins, cookies, and everything in between - I can look at all kinds of different language source code and figure out what's going on.

Other languages are documented too, but something about PHP and it's docs just makes it easier to start coding and learn.

PHP 1.0 - 2.0 - 3.0 ... (2, Insightful)

J-F Mammet (769) | more than 9 years ago | (#12768606)

PHP/FI 1.0 wasn't really a scripting language, it was more like a big perl (or was it C?) script that would put some variables in a html page. Not really that useful but a nice idea.
I discovered and started using PHP by the time the first beta of PHP 2.0 had been released. What a pleasure this was to convert my old clunky C CGI scripts to PHP. No more compiling, no more mallocs. Weee :)
7 years (I think, maybe it's 6) later I'm still using PHP for everything at work, and I certainly don't plan to use anything else (not that I could if I wanted, rewriting everything would take a few years...).
Congrats to the PHP Team, and thanks !

Slow to catch... (2, Funny)

ral315 (741081) | more than 9 years ago | (#12768609)

Apparently, it was so slow to catch that it was posted a day late!

Or is this a dupe from yesterday?

June 8th? (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12768653)

Let me look at my calendar...yep, it's June 9th. Typical Slashdot, a day late and a dollar short.

It's a good thing Slashdot isn't married.

that's pretty good (0)

Anonymous Coward | more than 9 years ago | (#12768676)

For a perl script cum slow [debian.org] perl clone...

Success of PHP easy to understand (5, Insightful)

iJed (594606) | more than 9 years ago | (#12768694)

I think it is obvious why PHP has become so popular:

1. It is very easy to learn

2. It is easy to use (unlike ASP.NET) and relatively simple

3. The syntax is derived from C and perl

4. It is free

Re:Success of PHP easy to understand (1)

nick-less (307628) | more than 9 years ago | (#12768811)

5. It features nice effects

$test = null;
if ($test==null) {
echo "test is null";
}
$test = array("1","2");
if ($test==null) {
echo "test is null";
}
$test = array();
if ($test==null) {
echo "test is null";
}

reply with your suggested result ;-)

Re:Success of PHP easy to understand (2, Insightful)

moof1138 (215921) | more than 9 years ago | (#12768924)

Two other big reasons are

5. It's fast.

6. It is easy for hosting providers to deploy. There are tons of hosting companies out there give customers PHP support because it is easier to support on a box running a bunch of vhosts. Other web scripting environmants either have security issues (mod_perl is really scary if you don't trust other people running on the same host), have limitations for what directories scripts are run from, or are just a PITA to deploy in a simple yet relatively secure way. (That's not to say that PHP apps themselves are secure, but that you can set things up so that when you 0wn the PHP app you don't get much else.)

Looking forward (3, Insightful)

joebp (528430) | more than 9 years ago | (#12768740)

Let's hope that in the future the PHP developers can come up with some ways to make the code produced by PHP developers more secure.

One of the huge problems with PHP is the massive number of XSS and SQL injection vulns present in code. Partially because PHP is used by beginners, but mainly because PHP does not help the developer write secure code. It's fast and easy to write, but allows you to shoot yourself in the foot. Just like C. See this paper on precise tainting [virginia.edu] for an example solution to the problems. It would break compatibility with most software written in PHP, but that's not neccessarily a bad thing when most of it is insecure trash.

Re:Looking forward (1)

Alioth (221270) | more than 9 years ago | (#12768868)

The real secret is PGP stands for Pretty Good Privacy, and PHP stands for Pretty Hopeless Privacy, hence the security holes!

Re:Looking forward (0)

Anonymous Coward | more than 9 years ago | (#12768898)

Don't you think all that is do with input validation though? Any language that accepts user input and tries to act on it is vulnerable I would have thought. It's not really the fault of PHP.

yu0 Fail I7? (-1)

Anonymous Coward | more than 9 years ago | (#12768750)

Least of Hwhich is

Completely necessary (0)

crypto55 (864220) | more than 9 years ago | (#12768760)

"?php echo 'hello slashdot!'; ?"
Slashdot removes brackets :(

< use the short form > (1)

ylikone (589264) | more than 9 years ago | (#12768815)

I prefer <?=$hello>

Re:Completely necessary (1)

PReDiToR (687141) | more than 9 years ago | (#12768937)

Slashdot removes brackets :(

Try using &lt; and &gt; =)

I get it just fine (0, Insightful)

Anonymous Coward | more than 9 years ago | (#12768787)

Much easier than the crusty old languages of the past like Perl or God forbid Python.

It's really easy for anyone to get up and running with PHP.

The only potential issue is that virtually zero hosts actually enable any of the safe mode stuff (Note I'm not bothered by register_globals; way overhyped problem).

th1s is goPatsex (-1, Troll)

Anonymous Coward | more than 9 years ago | (#12768873)

Yet another language.... (1)

David's Boy Toy (856279) | more than 9 years ago | (#12768933)

The thing thats always puzzled me about php is that it seems to be yet another language for no good reason. Why would I use php instead of Perl/Mason?

sweet (1)

rwven (663186) | more than 9 years ago | (#12768958)

I've been using it for about 5 years now and love it to death. Mucho Bueno! there is no more seamless interface to a mySQL database than that of PHP (IMHO)

You insensit1ve clod!? (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12768960)

PHP: Hypertext Preprocessor (2, Funny)

55555 Manbabies! (861806) | more than 9 years ago | (#12768976)

Here's to you, PHP, five golden manbabies of the goldest sort.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?