A Decade of PHP
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."
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.
Javascript + Nintendo DSi = DSiCade
Seriously, honest question. What's not to get about a language? It's just another language with different options, styles, formats, and uses...
-Jesse
Nothing says "unprofessional job" like wrinkles in your duct tape.
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.
Do you play with your Willy?
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?
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
Javascript + Nintendo DSi = DSiCade
You've done such a wonderful job that it's time you stop now and let something better take over :)
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
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.
Meh.
http://bbspot.com/News/2000/6/php_suspend.html
Technoli
No, no. Standard practice is to just send them to Wikipedia or a google search 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
Laws do not persuade just because they threaten. --Seneca
Wonderful, maybe... but Exciting? C'mon! It's a development language.
/gam/
I guess I'm one who still doesn't get it...
"In theory, theory and practice are the same; in practice, they are not."
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!
user@ubuntubox:~$ stfu This server is going down for shutdown NOW!
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 !
Apparently, it was so slow to catch that it was posted a day late!
Or is this a dupe from yesterday?
For a perl script cum slow perl clone...
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.
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
Whoever moderated this offtopic, are you on crack or what? How much more ontopic do I have to be?
Meh.
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 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.
"?php echo 'hello slashdot!'; ?" :(
Slashdot removes brackets
Due to financial difficulties, the light at the end of the tunnel has been turned off.
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).
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.
Javascript + Nintendo DSi = DSiCade
I prefer
Meh.
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.
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?
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.
The Internet is full. Go Away!!!
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.
- It's not the Macs I hate. It's Digg users. -
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?
True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
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.
Computers are useless. They can only give you answers.
-- Pablo Picasso
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)
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.
Meh.
Here's to you, PHP, five golden manbabies of the goldest sort.
Meh.
I really think PHP's success is about one thing: cut and paste. When I didn't know squat about creating dynamic web sites, it was PHP that was the easiest to learn. All I had to do was cut and paste someone else's script into my HTML and voila! Also the installation, configuration, and documentation are excellent.
But most PHP applications I've developed usually start simple but grow into a tangled mess of code. I've tried to seperate my programming logic using templating systems, but it's just so much easier to slap in code into HTML that I cheat a lot.
I've been converted to Ruby on Rails because it's faster and easier to write clean, maintainable code. But PHP got me into web programming, and is still what I recommend to people who want to start creating dynamic websites.
Ruby on Rails Screencast
The obligatory link: The Rise of Worse is Better
PHP finally reaches the average age of its developers and users! Way to go PHP!
PHP is an abomination.
It was very clever and very handy when it was first developed, but there are many much better systems for building web pages available today.
Its object-oriented features are kludgy, its syntax is a throwback to C, and it in a realm where string handling is ubiquitous, it provides you with such great functions as strtok() and strncmp(). I mean come on, haven't we evolved just a bit past using the C standard library for string handling in our freaking web applications?
Personal Home Pages is fine for whipping up a quick data-driven website, but if you want to build a large application it's crap.
I've been doing alot of PHP Programming over the past 3 years (after doing Java for the 4 years before that) and have grown to really like the language. It's easy, you can get started in 1 evening and if you have the proper background (ie: a few other programming languages), you can understand it (at least conceptually) just about as fast. If you know what you're doing, you can write proper frameworks the way you can in any other decent programming language.
However, if you don't know what you're doing, PHP makes it easy create to a garbled mess, tangled and obtuse enough give bad perl programs a run for their money. If you have the discipline to adhere to proper abstraction and coding guidlines, it becomes a very powerful language.
True, before PHP5 the object model was lacking but this should soon be a thing of the past. It's a great fit when coding dynamic web apps. It even makes a decent shell language + once you grok the idea of (generally) typeless data, you just appreciate it for the fact that it *just*works* and that it's practical.
Java on the other hand is fussy. I don't know how many times I've gotten a compile error when I passed an 'int' to an 'Integer' argument. I know *why* it's happening but I don't care! Java forces you be (theoretically) correct and complete, which is both a good and a bad thing. PHP *allows* you to be (theoretically) correct and complete but doesn't force you to do anything.
The biggest difference is the fact that java is further along in the frameworks which are available to the language. PHP has some nice stuff scattered in many places but nothing to really compare to Apache's Jakarta.
I was born clairvoyant and was writing PHP code in womb. BTW, if anyone wants I can give you a heads up on Linux 6.6.6 and Windows WTF. Those come out AFTER the apocolypse.
Give a man a fish and he'll eat for a day. Teach him to fish and he'll wipe out the species.
[Damn! I can barely read the effin' CAPTCHA - I'm going blind posting to Slashdot! ]
I'm a semi technical guy who runs a few websites for fun - I can't code properly (I'd love to learn, I just don't have enough time) but I love that I can get hold of thousands of open source web-scripts (Mambo, phpBB, Cutenews) that I can tweak and use for my sites. For that reason alone, I think PHP is great, and so are the guys who write and share those scripts.
We'll be celebrating the foisting of Windows 95 on the world sometime soon.
try { do() || do_not(); } catch (JediException err) { yoda(err); }
"the rigid OO structure and sophisticated APIs"
Alot of people just don't really like rigid and sophisticated:-)
You imagine me sipping champagne from your boot
For taste of your sophisticated API
I may not have a rigid OO structure, babe
But at least I'm enjoying the ride, at least I'll enjoy the ride.
I guess the other thing is that Apache/PHP seems to scale better (or at least easier/cheaper than Tomcat.
I may be going to hell on an elephant, babe
But at least I'm enjoying the ride, at least I'll enjoy the ride.
PHP is to Unix/Linux.
what
ASP is to Windows.
PHP is more powerful than ASP but in the end it's popularity is due to its short learning curve. As a project grows and requires better performance, scalability and maintainability PHP/ASP really starts to suck.
If you expect your project to become large you'll want to bite the bullet and go with JSP/ASP.NET.
--
This post is 100% free of zealotry and techo-religion.
Just a quick point--you can use Perl's regular expressions in PHP. And that's usually what I see people doing. As a matter of fact, it is recommended in the PHP documentation that Perl's regular expressions be used: Note: preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg().
A publicly traded company exists solely to make profits for shareholders.
Lucky for you there is a centralized, annotated, comprehensive, searchable, accessable by web services manual and a centralized repository of standard classes.
People underestimate the power of those two things. CPAN is the number one reason why PERL is still so popular.
evil is as evil does
PHP is a horrible language. Even perl is a better programming language. Java and Python blow it away in ability to create easy to maintain and efficient data structures. I'm amazed and fearful of the monstrosities that have been cobbled together with PHP (I'm talking about you Mediawiki and Drupal).
PHP is to web programming as x86 is to microprocessor architecture. It's nasty and inefficient and I can't figure out why so many people use it.
And like many other no-declaration scripting languages PHP is sorely lacking in warnings and errors. Forgot a dollarsign or typoed your variable name? Sorry, yer screwed!
To let you know where I'm coming from, Apache Tomcat is my favorite solution. But it seems that the project I most want to tinker with is Scoop and I'm finding mod_perl pretty workable and the way they architected that giant mass of perl is pretty reasonable.
</rant>
Start Running Better Polls
So here it is 2005, and I need to teach the "interactive" part of the graphic design curriculum to college- and graduate-level art students. Is PHP appropriate for this today?
In a semester, I'd like my students to learn some fundamentals of programming. Like, what a variable is.
I find that when "interactive" classes are taught in environments like Flash or Director, design students wind up cobbling together bits and pieces of things without really knowing how the pieces work, and then they get frustrated when the whole thing doesn't work. Plus the environment itself becomes confusing (there is really no logic to Flash). Therefore I'm thinking I'd like to go "back to basics" for a semester. Just as design students know a lot about how printing works, they should know how code works.
The Processing environment was designed for teaching-- a kind of simplified Java. But while its graphics support is sort of strong, it doesn't have great network connectivity, with the result that things you make in Processing tend to feel a bit self-contained, like science experiments.
Going the opposite way, what do people think about PHP as a teaching language? It has syntactic similarity to C or Java, for learning "if then" and whatnot, in a way which could be applicable to other languages later on; has a lot of functionality in the core language; and maybe unparalleled online documentation. There is no development environment to learn other than a text editor and SFTP. And even though the idea of your code running exclusively on a server might be confusing, I think there could also be value for design students to learn the difference between server and client since it's a fundamental relationship in a lot of graphic design problems.
Remember also that these are design students not comp sci students, which partially determines the kinds of programming issues these students need to be versed in.
Thoughts from about PHP as a teaching language for non-programmers?
Look it up and use it. Not that hard.
Meh.
This is not off topic. The poster had to glorify PHP and put down people who supposely "don't get it". Yeah he is entitled to his opinion - but if this reply if off topic the entire post is off topic.
Not flaming. No one has ever been able to tell me what niche php fills that perl and its modules does not. Please educate me.
Some drink at the fountain of knowledge. Others just gargle.
I've never seen a package of Apache for any Linux distribution that has PHP bundled in. What are you talking about?
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
Congratulations to the PHP team!
I've only been using FreeBSD since '02. But I've grown to like it very much and I exclusively use it for server-side webdevelopment.
I had an internship during my junior and senior years of college where they wanted me to maintain a series of webpages that ran in Coldfusion. I got them to change it around to PHP.
The only thing that bugs me about PHP is the exception handling, but I hear that it's getting better. PHP does things far better than Coldfusion (yuck), and it's easier than doing [Perl] CGI (IMHO - although I love perl). The popularity, I think, is due to ease with which one can pick it up, and also its similarity to other languages like C and Perl. And then there's the fact that it can interact with a wide variety of databases.
The LAMP solution works really well, although I use FAMP (FreeBSD, Apache, MySQL, PHP), which works equally well.
Vivin Suresh Paliath
http://vivin.net
I like
I'd mod you up if it weren't for the risk of losing karma from metamoderation of it. :)
"What is PHP" is the sort of question that a reference work is designed to answer. "So, what are some folks' real-world experiences with PHP, and how did it change your job?" isn't.
--grendel drago
Laws do not persuade just because they threaten. --Seneca
Html and php are too hard to understand, I am having better luck with java.
So what does the future hold for PHP? I can't seem to find any information on PHP 5.1.
Anyone have any secret tidbits?
put the data specific code in the sql. or on the server itself via stored procedures etc. the abstraction layer should be that - abstract, otherwise what is the point? your approach does not future proof - you assume that postgresql is the quintessence of database design. what if next year it isn't? oh well, you've tied your abstraction layer to it. by the way none of the issues you raise (foreign keys, stored procedures) have anything to do with the abstraction layer, they are server and query specific.
Database abstraction is a frustration of mine.
Say, for example a "real" DBA writes a shopping cart schema / application, using a "genuine" (ACID-compliant) DB, the scalability will be phenomenal; The speed will be incredible because much of the code will be handed TO the database -- not parsed and parsed and parsed away at the PHP/Java/whatever-script level.
Now, let's say a "wannabe" DBA writes a shopping cart schema / application using MySQL. Then to "help" the Postgres folks out, the DBA adds an abstration layer. Woo hoo!!! Useless... Essentially, I'm offered a way to drive a Ferari (Postgres) down the sidewalk, negotiating with pedestrians all day, as if I were traveling by skateboard (MySQL).
Unfortunately, the number of examples of the later are a dime a dozen. The number of examples of the former are near zero. Think about why you'd even WANT abstraction. In most real-world cases it's rather useless and undesireable.
Well, your anecdote of 2 ColdFusion sites that crashed doesn't really prove much.
I've been working with ColdFusion for about 5 years now. My sites don't crash- and I get 10-20 million hits per month. Not huge, but a pretty good number. (No...this is not the site that is in my sig...)
I *might* get 2 or 3 'unhandled exceptions' in a day. And those are always caused by search engines that are hitting templates with bad queries. It is interesting to see the queries they send, "hmm...why did they decide to make the usernumber 99A4 this time instead of 994" the error is caused because *I* foolishly forgot to put a val() function around the number in a query. So I fix it, and move on.
If the person running the server has half of a brain, their sites won't crash. I've used ColdFusion from version 3, on up to 7. And they always put in great new features and capabilities that other web programmers need to work hours to duplicate- but for ColdFusion it is a built-in function.
Yes, people have been making fun of it for years- and it reached a peak when FuckedCompany was complaining about it a lot. But there are so many good things about it a lot of people turn a blind eye to. Hell, the Verity engine itself is worth the entire package price. I can set up a searchable index of PDF, Word, Text, files in about 30 minutes. This is stuff that people want, and really appreciate.
No reason to lie.
I, too, have PHP to thank for a wonderful career. While I know that PHP is not the best language for the massive applications I've done, PHP developers are relatively easy to find and train. That is a major marketing factor for companies. Rails is great but how many (available!) workers are there? Very few. Same with Python. PHP can be very powerful when done right. The last major system I wrote with it included a call center (using the wonderful company Voxeo for hosting) that dropped right into the CRM and loan processing software. The current system includes a self-running tiered hosting system (Bind 9, Apache 2, PHP 5.1-dev, PGSQL 8); the daemons (written in PHP) detect server load and move sites accordingly to other slaves.
When I was trying to decide whether to learn PHP or Perl a few years back, I ended up deciding on Perl. My programming syle is: Give me a few simple commands I can easily learn, I'll figure out how to get the rest working. (Plus, cpan is just cool)
Also, I like to write a lot of simple CLI programs, and Perl is a natural for that. (Though I still write many of mine in C++ for the speed boost)
"That's so plausible, I can't believe it!" - Leela
Versions of CF less than 5 years old pretty much spank PHP. As soon as it got first-class UDFs, the power really expanded. CFCs are super. PHP gives you much easier access to some a lot of low-level functions (file manipulation is a pain in CF), but CFs modularity (what? There's more than just includes?) and stuff like the cfquery/DB abstraction layer is far superior to PHPs.
I like PHP because it's basically a bastardised dialect of Perl, and I like Perl.
I like Perl because it uses different operators for string concatenation and addition. That doesn't sound like much of a reason, but a lot of the programming I'm doing seems to call for either adding numbers or concatenating strings.
Now, in some languages, strings and numbers are completely different types. Then it's sort-of OK to recycle an operator to mean something completely different, because the computer knows what you mean. But there are several dynamically-typed languages which use + to concatenate strings. Then the magic guesser gets its knickers in a twist with not being able to work out whether something is really a number or just a string that looks like a number. This causes problems when you try to add numbers and find yourself concatenating strings. I wasted the best part of a day on a stupid bit of JavaScript for a DHTML application with increment/decrement buttons.
In Perl {and in PHP}, 3 + 4 gives 7. "3" + 4 gives 7. 3 + "4" gives 7. And "3" + "4" gives 7. If you actually want to concatenate the 4 onto the end of the 3, you have to use the concatenation operator . instead of the addition operator +. 3 . 4 gives "34". "3" . 4 gives "34". 3 . "4" gives 34. And "3" . "4" gives "34". That is simple.
Perl is a bit of a 'mare for n00bs because everything is a shorthand representation. There is the wonderful $_ which avoids cluttering up your script with temporary variables. You don't need brackets round function arguments {like the British BASIC dialects of the '80s}. Everything is optimised for the hardcore hacker, not the beginner. It only looks pretty when you realise that simplicity is beauty.
PHP has a more consistent interface than Perl. So you can't just drop in a regular expression, you have to call a function with the regular expression inside a string. It also does more stuff automagically for you, like keeping hashes ordered {Perl doesn't bother, expecting you to keep a separate array if you really care} and dereferencing everything {Perl expects you to manually create and dereference references when you make multidimensional arrays}. So it's probably a bit slower running, but it's quicker to get an app up and running.
Je fume. Tu fumes. Nous fûmes!
If you know the basics of multitier programming, you can make wonders with PHP. I built myself an MVC framework based on a php-based template engine (search 'Beyond the Template Engine' in sitepoint.com).
:)
To add a new module, I just copy/paste from a previous module.php. The business tier functions are in the business subdirectory, it's just a matter of creating a new lib and add the corresponding functions.
The data-tier uses a (secured) derivative of PHPLib's dbmysql.php (there's a subclass for reading, and a subclass for reading/writing).
And what can I say about the templates? They just get the $data array. The greatest virtue of PHP IMO, is its recursive associative arrays, they're wonders for multitier!. The rest of formatting is a bunch of heredocs, sprintf's and echo's.
As for the always-used functions, i.e. security, privileges, etc, they're in the core/ subdirectory, and called by prepend.
It took me a couple of weeks to write it (after having studied multi-tier programming of course), and slowly i've been making modifications. I've added web setup and table upgrading(installation), database backups, a user log, upload/download logs.
Now, not everything is perfect. There IS a downside to using MVC in PHP: Adding new modules is so easy it gets boring.
See, It's not that there aren't ways to program a good e-business app using PHP. To quote Guybrush Threepwood,
"Yes, there are. You just never learned them."
And for all the power (maybe more) of PHP with simplicity and consistency, there's Lasso. It's not free, but it's worth every penny.
Does anybody know where I could find the PHP roadmap (if there is one). I looked all over the place, searched the php website and mailing lists, searched google, but I got nothing. What's in PHP's future?
And Zend has the same corporate machine to push it's products as MS?
PHP is the single easiest language to write simple web applications with. And by "simple", I really mean simple. Everyone suggesting Ruby on Rails to replace PHP has valid points, but forgets this little feature. Let's just compare the two for a moment. With Ruby on Rails, I read a 5-page tutorial that gets you up and running with a basic application. Just getting the application created took two pages of the tutorial.
With PHP, when you want to get started on something, you don't have to invest any time at all into setting yourself up to begin. You just dive in. The only command needed to start a PHP project is 'vi index.php', and immediately you are working.
You can fight over which language is the best at actually doing the job all you want, but the most popular language is the one that wastes the least of your time on logistics. That's why Perl is so popular for scripting, and it's why PHP is so popular for web applications.
Ten years of hard work. Now the tired PHP has earned a well deserved rest. Ruby on Rails is much more energetic at this point.
I use PHP as one of my main languages, but you make many good points. I really hate the function-name inconsistency -- it's a good thing it's so well-documented, because I need to look up the correct spelling nearly every time I need to use some string function. Or nearly any built-in function, for that matter.
Another thing I dislike about it is that it's not fundamentally object-oriented. That's one thing I absolutely love about Python -- _everything_ is an object. I love being able to perform methods on strings and arrays, instead of having to pass them to global functions. And with PHP's built-in functions, there's so much C-style pseudo-object-oriented programming ("POOP", appropriately), like where you call a method to create a session or context object, and you pass that context as the first argument to other functions that work with it. That's just bewildering. There's object-oriented support, so why on earth must they have such unelegant messes of procedural programming at the core?
The only reason why I stay with it is that it makes web programming much easier, since it can act like a template language, embedded within HTML pages. For serious non-web programming, I've been migrating to Python, for maximum harmony. I just wish it had better documentation.
Signature.
So you came accross a few sites that someone programmed poorly.
"but it just doesn't cut the mustard for robust and reliable web code"
Yes, It absolutly does. You obviously haven't used it on a high enough level. Extermely reliable code. Once you code it right, it will work everytime.
Reliable code is up to the programmer (scripter)
But, since this is super slash dot, I'm sure I'm outnumbered on the site.
Before I speak, allow me to point out that I've worked with ColdFusion for several years myself. So I know what I'm talking about when I say IT SUCKS!
The purpose of languages like Java (and by extension JSP) is to prevent programmers from making really stupid mistakes that make sites unusable. ColdFusion has NO protection against stupidity, and will happily blow up in the tinest of situations. Especially when its coupled with Stored Procedures (the 'Standard').
And yes, I'm leveling these accusations against CFMX as well. CF is just painful to work with, and creates many more problems for the programmer and users than it should.
Javascript + Nintendo DSi = DSiCade
are there any sites using jsp anywhere near the number of pages/day of Yahoo?
r u=http://www.ebay.com/).
The largest jsp site I've heard of is ebay, ~1/3 the size of yahoo, and still using IIS for many of their hi-load parts (https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&
BTW, why is it taking ebay so long to switch over to jsp?
Yahoo switched to PHP from their in-house scripting language.
And evaluated & rejected J2EE and jsp in the process. I'll let you google that for yourself:-).
Please note, however, that CF costs moh-naaaay whereas PHP doesn't cost anything. I also use it for semi-enterprise stuff - works fine. ("but you can't afford CF?" - no, I'd rather save the money).
There are several PHP-based MVC frameworks. My favourite is Cake, who's basically an attempt on implementing Rails in PHP: http://sputnik.pl/cake/
That's why I love it!
Also, PHP is popular with bosses for writing windows drivers. This is called PHB-PHP-PNP.
feh.
I've been developing website backends in PHP for 3 years, and large enterprise-scale apps for the past 1 year. It's a common misconception that PHP isn't appropriate for large applications.
It's all in how you use it. Do you hack together a bunch of pages with isolated scripts talking to html forms and databases in an ad-hoc manner? Or did you start with a solid application design model from the start and follow through with time-tested methodologies?
PHP gets a bad rep because of the large number of inexperienced developers using it with poor results. I've developed full CRM and ERP apps with it including invoicing and ticketing systems that scale beautifully and are a dream to maintain. PHP is fast, free, and easy to use.
It's the responsibility of the developers to use more mature practices when developing large apps- and to recognize the fact that small site admin areas often evolve into larger apps. Plan and design!
I hate to break it to you, but the first AC wasn't me. The "first post" by me was the first post of this thread. I have no need for such silly AC games. Especially since my Karma is perpetually at its cap. Even if I were to get modded into oblivion a few times, it wouldn't even put a dent into the karma I earn from normal discussions. So, nice conspiracy theory there, but try again. :-) --AKAIB
Yes, that is a commonly heard complaint. "It has a low barrier to entry, and does not force you to do things correctly."
Oh well- that doesn't mean that it doesn't do really good things when people actually know how to use it.
I can still churn out good sites, good features, good logic faster than anyone else I know who use other languages.
And once again, if you are having problems with stored procedures, I would say you are doing something wrong. I use them fairly frequently, without problem. (SQL Server)
Version 4.5 was painful- it would suck up all of your memory, then die a painful death. But versions 5, 6 and 7 have been very stable. 6 and 7 are extremely fast.
I think it is a very good product. Not discounting the usability of other products, but this one mistakenly has a bad reputation.
No reason to lie.
http://phpweblogs.com/phpcake.jpg
:)
Yeah, we're a bit over the top for PHP. The whole company had cake and ice cream to celebrate.
creation science book
If anyone needs an easy installation of PHP on a windows platform, try EasyPHP. The site is all in french, but it's free and good. It automatically installs and integrates PHP, MySQL and an Apache server.
Personally, I've set up a lot of moodle sites (www.moodle.org) which is the best free LMS I've found.
Check it out if anyone is into e-learning or web based training.
(Make sure you have a fast server if you want to put a lot of students on it. The quiz modules are very useful, but they use an ungodly amout of resources if you're teaching a class of +30 students.)
___
It's the end of my comment as I know it and I feel fine.
My problem with PHP is the great sin of integrating layout with functionality.
ADOdb Site
I've never used PEAR, so I can't compare the two, but ADOdb is quite nice from my experience.
The roots of education are bitter, but the fruit is sweet.
--Aristotle
...the best thing about PHP is that every cheap hosting service includes it. It has already won. Yea like it is the only poor technology in the history of technolgy that has won.
Still, I have to feel with xmlHttpRequest being promoted so heavily the server side scripting as a whole will eventually die.
PHP is great. Would we all rather be scripting in asp?
Ten years and the == operator is still completely broken. Any hope of fixing it in the next ten?
Suppose A equals B, and also B equals C. Any reasonable person would expect that A equals C, right? Oh yeah?
Try explaining that to a first-time programmer.I'm sick of people asking me if a browser could fail to render PHP.
They don't get it, what my PHP app is churning out is something between HTML 3.2 and 4 (I don't claim to be fully 4.0 when I'm not)
This is not JavaShit people...it is taken care of by the server before your browser even gets ahold of it.
*anger*
*anger*
*anger*
Ok, time for a coctail.
--
Random Signature #2
Generated by SlashdotRndSig via GreaseMonkey
Make America grate again!
The most fundamental aspects of the language are broken, and will probably never be fixed because they are so entrenched. Here's an example.
Suppose A equals B, and also B equals C. Any reasonable person would expect that A equals C, right? Oh yeah?
Try explaining that to a first-time programmer.I maintain a website built around an interesting collection of commercial, open-source and homebrew code. Recently, we had one bug where one part of the site would stop displaying any data, seemingly randomly.
The only bit of information I had in the bug report was that occasionally that particular section of the site would die horribly, and it would only happen in Firefox. There was no browser-specific code, nor anything obvious that'd cause it.
After about a month of on-and-off head-scratching, I figured it out - and the problem was partially caused by REGISTER_GLOBALS. Another part of the site (built with a different product) was setting a cookie with a paramater name used by the first. The cookie took precedence over the empty querystring, and the first piece of code ended up using a random session ID as a search string.
Why the Firefox red herring? The component setting the session ID cookie was only used by the site staff, and we all use Firefox. When we dropped into IE, we'd only look at the public areas of the site, and so never recieved the session cookie from the staff areas.
Yes, this could have been fixed by code changes in one or both of the applications (and in the end, that's what I did - my initial knee-jerk reaction was to turn off REGISTER_GLOBALS entirely, but yet another package on the site depended upon it). But, REGISTER_GLOBALS encourages action at a distance - in this case, logging onto one part of the site affected an entirely different part. There should not have been any coupling whatsoever between the two components - but thanks to PHP's "helpfulness", a link was created.
Eventually, I hope to get rid of dependencies on things like REGISTER_GLOBALS in the things I maintain. For preference, I'd do that by switching to Perl or Python, but I don't have the time to do that. Instead, I'm stuck in PHP, and cursing some of its more interesting misfeatures...
Two reasons why we use a database abstraction in my open source project.
1. We offer support for MySQL, PostgreSQL and Oracle in the product. People want to run it on those databases, and with an abstraction layer we can provide support for them. If you don't abstract out the database, then you're going to have a hard time time getting database independence.
2. Writing testable code. With a database abstraction, you can inject a mock database object and use it to exercise your code without having to actually talk to the database.
Products like PHPAudit make PHP commercially viable as well. You can actually embed the licensing system into your PHP applications and use an encoder such as ionCube or Zend to create byte code that will protect your work from piracy.
I tried learning PHP, but I just didn't "get it".
Authority questions you. Return the favor.
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?
Most of the functions in the PHP distribution are named after a function that does the same thing in the C library that PHP uses to implement the feature. PHP is designed so that if you're familiar with the C library that it is using, you can very easily get the hang of the PHP version.
This doesn't excuse some of the weirdnesses in the core library, though -- str_rot13 (and the other string functions with underscores in them) is clearly wrong, as the earliest string functions followed the standard C library naming conventions.
To address your other examples: isset() is an operator that looks syntactically like a function, and would have been named in this fashion to mirror the other such operators (sizeof(), unset()). is_object() et al are functions that were implemented independently of this, and at the time there was no conflict. I see no excuse for the php_uname/phpversion difference.
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!
I don't like to nitpick, but... those aren't all core functions. They're just functions that are distributed with the core, kind of like the applications that come with a Linux distribution. You can build a stripped down PHP without them, if you want.
Sure the function names are varying, but that can be fixed eventually
At the expense of backward compatability. Who's going to pay to rewrite all that code?
The Anti-Blog
if they had to switch their serverOS to use jsp, then it certainly would have been harder/more expensive to use jsp just in switching/retraining costs. If they had touse a commercial server platform to get equivalent performance, it would cost even more.
Of course we don't know how much it would cost to scale jsp to handle yahoo's load b/c no one has tried it yet. Hopefully ebay will release some numbers when they get it going and then we will have some real world data use to evaluate whether jsp can scale to handle the loads php can, and what that might cost to do.
So the best we have now is that jsp might be able to scale as easily/cheaply/well as php, on the right servers (what serverOS would you suggest?). Or maybe not.
By the way, do you think IBM's 'embrace' of PHP might have something to do with their experience with ebay?
No need to sacrifice backward compatibility. If we want underscores as standard, simply make a new function is_set(), identical to isset(), deprecate the old one, and leave it at that. Old scripts will work, but new ones can be made in a coherent fashion.
True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
Note that "Perl-compatible regular expression" isn't really completely Perl-compatible, but they might support some features that posix regexes don't and Perl does..
The point being that it's completely wrong to say "you can use Perl's regular expressions in PHP"..
What you are missing is that it takes more to do Java. More resources, more knowledge, more expertise. You may have those things, but many more do not.
I wrote up some of my thoughts on the issue here:
http://dedasys.com/articles/scalable_systems.html
http://www.welton.it/davidw/
Pre-dating PHP is MetaHTML, developed by Brian Fox (original author of BASH) and Henry Minsky. See the examples.
It lets you define your own macro tags, and it can access MySQL and other databases.
Try it if you prefer a cleaner syntax.
PHP might be easy to pick up, but boy oh boy does it encourage some bad practices. After I picked up ASP.NET, I said goodbye to the ASP/PHP paradigm and never looked back. I always shudder when I have to hack around with my Wordpress plugins, because they're just a mess of HTML interwoven with conditionals and loops. BLech! That's so 1998! Still waiting for the OSS response to ASP.NET...
Seriously, honest question. What's not to get about a language? It's just another language with different options, styles, formats, and uses...
Try learning Navajo, or Basq, starting at an age greater than two years. Then say that again. B-)
Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
http://news.com.com/2100-1023-963937.html?tag=lh
I've wondered how that turned out. I didn't read any disaster stories... did I miss them?
-pyrrho
I'll be the first to admit that I know precious little about Perl. So maybe you could educate me a little more here. Specifically, I'd really like to see a regular expression that you could use in Perl that you couldn't use in PHP.
A publicly traded company exists solely to make profits for shareholders.
$a = 'abc'; //OMG $b has the chr 'b' in it
$b = $a[1];
Perl people are just jelous =P
okay, make a list of all the PHP functions whose parameter order or phrasing causes your brain to overheat, and then tell me whether you prefer camelcase or underscores, and I'll have the perfect language for you by tomorrow. Only you'll have to ignore all the extra functions that may duplicate the functionality of others, if you want there to be OWWTDI.
Seriously, if your only (cribbed) gripe with PHP is that perl has regular expressions built into the language syntax, and PHP uses functions, some of which may seem redundant) that's high praise indeed.
I don't understand the point of this statment. What yahoo said was they didn't choose jsp/java because FreeBSD's threads suck. That's not Java's fault. That's FreeBSD's fault.
"Of course we don't know how much it would cost to scale jsp to handle yahoo's load b/c no one has tried it yet."
We also don't know how much it will cost for Yahoo to completely handle Yahoo's load. Yahoo didn't rewrite their whole site in php and according to them, they have no plans to. "With recent advances in PHP, we have decided to adopt it for some of our new developments, in preference to some of our internally developed technologies,"
They're basically using it for new stuff instead of yScript2. And according to the presentation, one of the reasons they chose PHP is that they can tie it in to their existing C/C++ backend or to new C/C++ code when performance is critical.
So, we don't know how much of Yahoo's processing is done by PHP, yScript, yScript2 or C/C++. But we do know that it's not all PHP. And they're not using PHP alone, they're using ioncube's php accelerator which is free but not open source.
I don't know if you're trolling or you've only read the headlines. I'll give you the benefit of the doubt of not knowing the details. That link to the presentation should clear up some stuff.
"Hopefully ebay will release some numbers when they get it going and then we will have some real world data use to evaluate whether jsp can scale to handle the loads php can, and what that might cost to do."
Sun had released some information regarding eBay. They were consutling on the project as well. Their servers are Sun servers running Solaris. eBay gets something like 1Billion hits a day, which is comparable to yahoo which I think gets 1.5Billion. Yahoo has over 4500 servers, that works out to about 333,333 hits per server per day. That doesn't sound all that impressive to me.
Hopefully ebay will release some numbers when they get it going and then we will have some real world data use to evaluate whether jsp can scale to handle the loads php can, and what that might cost to do.
" By the way, do you think IBM's 'embrace' of PHP might have something to do with their experience with ebay?"
IBM will embrace anything they think will make them money. I don't think it had anything to do with eBay. IBM makes hundreds of millions of dollars from Java. The deal IBM struck with Zend is to develop Zend Core for IBM which is just a set of tools and integrations into IBM's database products. Namely cloudscape and db2. Cloudscape is open sourced but db2 isn't. Couldscape is a teaser to try and get people into DB2 if their needs ever outgrow cloudscape. All IBM is trying to do is get PHP developers to buy more of their products.
If you only read the headlines I can see how you might think more is going on but it's not.
Open Source Java DAO Generator
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 ;-)
Ah, you took the words out of my mouth on this one :)
Signed -- another ColdFusion developer
This signature is being generated randomly.
Interestingly, perl has exactly the same concept of an object as python. Exactly, 100% isomorphic. Python just hides it in syntactic sugar. Perl 6 and ruby now hide it to. But underneath all objects are containers like a hash or array that hold the attribute names, and know where there namespace methods are located.
In perl an object is normally a hash that know the name of the file it was declared in (the Bless operation installs the name of the current package/file into the meta data of the hash variable. ) Now it's easy. all attributes for the object are just the key values of the hash.
Whereas in C++ or pyhton you might write:
x.a
in perl this is
$x->{a}
That is, to get the attributes value just look it up in the hash using the attributes name as the key. Pyhton is doing exactly the same thing under the hood.
Methods are accessed using that package/filename one squireled away when the object was created or "blessed".
so if I wanted to assess a method (e.g. x.meth() in python) in perl I write:
$x->meth()
perl just goes the right file or package and finds a method by the name meth(). under the hood it's actually looking for a method named:
PACKAGE_NAME::meth()
so that you can have the same name meth() in different packages.
Finally inheritance is dead simple. You have a list of other package names. any method not resolved in the current package is searched for in all the packages in the list (in order) till it is found. (this also means an object could in principle, re-write its own inheritance hieracrhy if one could think of a good reason to do so).
Ruby and perl 6 hide away all those dereferencing arrow -> and braces and make it look like python. deep down its essentially the same.
Some drink at the fountain of knowledge. Others just gargle.
It doesn't matter what Yahoo is running or what eBays is running. The vast majority of people out there are not going to be building sites that handle anywhere near the traffic that those sites handle. If your page renders in 100ms or 200ms it's not that big a deal.
What is important is that you figure out your needs, know what you need to plan ahead for, evaluate the available resources to achieve your goals and choose a solution that works with the skillsets of your team. Making a decision based on what unrelated websites use is a mistake. Almost anything can work. eBay went for years running on a single 3.3 million line dll. Eventually it got to much for them and made it difficult to add enhancements so they switched to J2EE. Yahoo built their own scripting language because there really wasn't anything comparable out there at the time. They even used their own webserver until apache was good enough.
Open Source Java DAO Generator
We also don't know how much it will cost for Yahoo to completely handle Yahoo's load.
Actually, we do. Update your sources. Yahoo is ~3x as large as ebay, and all their presentation logic is in php.
"For example Yahoo!, which serves up 2.85 billion page views a day and supports 345 million visitors a month, uses PHP for all its presentation logic."
And of course their processing isn't all PHP. In fact one of Radwin's core points was that you can take repeatedly run php scripts, and turn them into php extentions to improve performance. It would be foolish to do heavy processing in php (or jsp).
Their servers are Sun servers running Solaris. eBay gets something like 1Billion hits a day
Rather goes to the heart of this issue, I think:
If x 'sux' on your servers (and remember you have hundreds of them), and x is required for y to work well, and you would need to buy expensive commercial servers to use y on your site, and z does as well or better on your existing servers than y could with servers that supported x, you would be pretty silly to replace your servers (or to run around trying to figure out who's fault it all is).
So the question was what servers would be required to get jsp to compete on scalability with php, and your answer is Solaris? Or do you just not have any idea?
they're using ioncube's php accelerator which is free but not open source.
So that IS kind of like java, then:-). On the other hand, Yahoo could switch to an open source accelerator if they wanted/needed to.
When is Sun going to open source java?
Since regexes must be quoted, there is a problem with the /e modifier which cannot be fixed.
See: http://bugs.php.net/bug.php?id=15050
It comes down to this:
$text=preg_replace("/(.*)/e","'\\1'",$text)
will never work right if $text contains the character ", and
$text=preg_replace('/(.*)/e','"\1"',$text)
will never work right if $text contains the character ',
because a backslash is introduced.
So you have the write a function to remove the \ and put that function in the replacement string.
And plenty of other features are missing that Perl has with m//, s///. For instance, m//g.
In general, Perl is more reliable than PHP, and I prefer it, but PHP does have two advantages:
1. on a typical Linux/Apache system, without mod_perl, Perl spawns a process on every reequest.
2. session-handling.
It's KISS, not KICS. You can argue that PHP isn't consistent (although it's a tired argument), but you've done nothing to support your claims that it isn't simple.
PHP's simplicity stems from some of the things that you complain about - verbosity being one. Whereas Perl (a language I also love) has many powerful operators, these are not intuitive. An inexperienced developer has a lower chance of intuiting the purpose of a cryptic Perl operator versus a verbose PHP function name.
As for the consistency argument, much of that also stems from the fact that many PHP developers are also C developers. I think Rasmus once said something like, "If anyone ever changes strlen() to str_len(), I'll cram an entire K&R book down their throat."
okay bullshit. How is registering each odbc connection really a layer of abstraction? Plus what about sql nuances between databases? Try using a real abstraction layer like Pear with php. You just give it a database and login info and you are good to go. That is abstraction.
Someone's gonna get it from the meta-mods..
A lot of people still don't get it, but you can't argue with its success.
:-)
On slashdot, of all places, you're saying we can't argue about something?
So, how's Unicode support in PHP these days?
*...cricket chirping...*
It's great that PHP is being used by lots of people, but as long as it doesn't support Unicode, I'll never be able to use it on big projects, which means I'll never use it for projects that might grow big, which means I'm pretty much avoiding it altogether.
PHP may be more popular overall (or may not -- I'm not sure I believe that). But I suspect Python is much more popular with the "alpha" projects (in the sense of "alpha male", not "development"): big projects, international projects, etc. Given the choice, I want to bet my program on a langauge used by the top projects, not by the most projects.
A decade of PCP? Do you have any brain cells left after that?!
:)
Oh, you said PHP. Well my question still stands.
Just because it CAN be done, doesn't mean it should!
2. session-handling
CGI::Session.
== Jez ==
Do you miss Firefox? Try Pale Moon.
See if my site crashes. Then guess what language it was coded in (hint: not PHP).
:-)
Yes, I know I'm probably inviting someone to destroy it now. Oh well.
== Jez ==
Do you miss Firefox? Try Pale Moon.
The shop I run has been coding web apps in various languages for going on 7 years now.
Once we dropped the others as much as possible and focused on php, our productivity went through the roof.
It's much faster to write the application in php, then identify performance issues and code those functions as c++ extentions than it is to write the whole thing in java. This is Radwin's point, and I've seen it proven repeatedly in practice.
'Java's as fast as C++'. OMFG. LOL.
This is why:
Mass Virtual Hosting with php:
1. set up apache for mass virtual hosting (likely with some control panel)
2. load mod_php
3. done
Now sure there's security risks, but if you use safe mode and restrict your base dir, you can alleviate a lot of that.
Now compare that to mass virtual hosting with jsp/servlets:
1. Load a seperate instance of tomcat per user on your machine
That's a big thing to do, and can result in a LOT of memory being used compared to the "1 apache to serve them all" model. That's why you won't see it on most 5$/month type hosting models, but will see it on dedicated (you get your own full server or virtual server) hosting models.
1. What is a PLP file?
;-)
2. I'll be nice and forgo any attempts to append ';drop database; to the query strings.
Javascript + Nintendo DSi = DSiCade
"you can use Perl's regular expressions in PHP."
Nope. You can't. Well, you can. Well, sortof. Sometimes. With some syntactical exceptions, and lots of thinking about escape sequences, and passing parameters a different way. And that's the gotcha. You start thinking it's going to be the same -- and it's not.
Tweet, tweet.
when casual users talk about advantages,
they always expose their ignorance
1. apache spawns processes, and without mod_php,
it will spawn a php process on every request
2. you're joking right?
Despite the majority of the Anti-PHP comments posted here being lucid, informational and non-confrontational, they are still moderated down.
PHP programmers - the Amiga owners of 2005.
Command attempted to use minibuffer while in minibuffer
You don't even need to have something complex to wrap vendor-specific libraries. Make simple functions such as "openDB()", "query()", getNextRow(), and "execSQL()" that wrap vendor-specific stuff. Generally you only use one vendor at a time anyhow. Make an optional selector parameter if you need multiple vendor selectors. (Although PHP is goofy with optional parameters sometimes. I hope they fix that.)
Table-ized A.I.
one site to explain it all
1. PerlPage; embedded Perl.
2. You can try. I think I've tested it quite thoroughly.
== Jez ==
Do you miss Firefox? Try Pale Moon.
performance != scalability.
The original point was 'jsp doesn't seem to scale as well as php', and none of the reams of text you've pasted here comes close to disproving that.
What would are some very large sites using jsp, which for all the links you posted, you haven't been able to show.
More and larger sites use php than jsp. I pointed out ebay, which is still using dlls for much of it's heavy load. You brought up playboy, which seems to be mostly a static site running some cgi scripts: http://cyber.playboy.com/cgi/ab.cgi.
The proof is in the implementation, we know php scales and jsp, well there are plenty of fanboys who will post endless scholarly diatribes about how great it would be if someone would listen too you, but you don't seem to be able to produce any very high load sites to back up your case.
So I'll ask again, what are the largest sites running jsp? If you are going to post benchmarks again (b/c you can't find any jsp sites of major size), please try to stay on topic: benchmarks showing how java/jsp handles thousands of concurrent users, how it compares to apache/p* in a high performance cluster, etc.
A big problem in hacking on other's PHP codes comes from the fact that the PHP code patterns of other people's code don't only contain the result of their preferred coding style, but also of the fact on which of a function out of several to accomplish a certain goal they've stumbled upon first.
This means that if you take several code portions written by different people that accomplish a certain task, they will look not only differently structured, but will also to a great deal use a different set of functions/methods.
"those aren't all core functions. They're just functions that are distributed with the core" ... is that there's no module mechanism in the language: all of them share the same namespace and name clashes can and will occur.
class alone won't cut it.
I don't feel like it...
1. apache processes: PHP as a module is the most common setup I've seen, while mod_perl is a problem, esp. with shared hosting.
2. Sessions. PHP tries some good stuff, including rewriting all your links with the SID if cookies are disabled. But yes, PHP's possible flakiness is worrisome. Perl's still the gold standard for me. But compare trying to do *very* simple Sessions:
PHP:Perl:
CGI::Session::CookBook
It's KISS, not KICS. You can argue that PHP isn't consistent (although it's a tired argument), but you've done nothing to support your claims that it isn't simple.
But I'd say consistency and simplicity go hand in hand. If you need to keep looking at the documentation (as one respondent above claims he does when using PHP) or remember lots of functions parrot-fashion (like learning French nouns) then it's not "simple", is it? Simplicity is consistency.
I realise that, the point to me was, that question was redundant, therefore the ansver is too redundant.
If I'm reading a thread about PHP I actually can du just fine without posts explaining the basics of it, that's why I browse on +3.
Also, it's an interesting strategy that I have thought of trying some time, that's something moderators should be aware of even if your case wasn't that.
If you ever plan on writing cross-system compatible code, you'll soon stop using that.
It is NOT depreciated. mysql_escape_string and mysql_real_escape_string do two slightly different things. Read it at php.net for yourself.
Meh.
thank you PHP. i owe you my life.