Slashdot Mirror


Advanced PHP Programming

sympleko (Matthew Leingang) writes "PHP5 has hit its third release candidate, so get used to the idea of using it. George Schlossnagle has written a great book on PHP programming which ought to generate some enthusiasm. But it's not just about PHP5: the book includes great information on everything from coding style to high-level problem-solving. I met George through a friend of mine who works for the Developers Library, and I'm glad to have finally gotten a look at his book." Read on for Leingang's review of Advanced PHP Programming: A practical guide to developing large-scale Web sites and applications to PHP5. Advanced PHP Programming: A practical guide to developing large-scale Web sites and applications to PHP5 author George Schlossnagle pages 609 publisher Sams Publishing (Developers Library) rating 9.999/10 (I don't give perfect scores) reviewer Matthew Leingang ISBN 0672325616 summary See subtitle

Many of the previous generation of PHP books were fattened with lots of filler: how PHP imports form-submitted variables into its namespace, definitions and examples of valid XML documents, one-line summaries of every PHP function, even an HTML reference. It's like going to Gallagher's Steak House and filling up on free bread. Ladies and gentlemen, may I submit the Atkins-Friendly PHP book. This is not a book about syntax or data structures. This is a book on how to use PHP in enterprise environments. During my first read, I realized around page 126 that I had already learned as much as I had expected to learn and I was just getting started!

The book is very well written, with a friendly tone that is neither pedantic nor partisan. A knowledge of PHP before version 5 is assumed, and the situations tackled are very much from the real world. The focus goes beyond getting what you want to appear in the browser, too; scaling problems of very large web sites, managing a code base with multiple developers, and building your own extensions to PHP are all discussed.

The author draws most examples from a Unix + Apache + PHP environment, and MySQL is the primary database used. The examples are all in PHP5, but many ideas can still be implemented in PHP4. In other words, you can still learn a lot even if you're committed to PHP4 for the near future.

Part I of the book is called Implementation and Development Methodologies (some of these part and chapter names could be a little less clunky, even if they are correct), and the first chapter is about coding style. After that comes a thorough discussion of the new features of PHP5. These are language aspects that are commonplace in other object-oriented languages (e.g., java and python), but which I admittedly knew little about:

  • encapsulation: the ability to keep object attributes and methods private or protected;
  • static attributes and methods to make class functions or singletons;
  • user-definable constructor, destructor, accessor, mutator, and copier functions;
  • interfaces, which are like abstract classes. A class can implement one or more of these as well as extend a concrete class;
  • exceptions, which allow propagation of errors and warnings back up through the function stack.

Other PHP programming concepts are discussed in this part, such as templating, using the command-line interface, and unit testing. The chapter on Managing the Development Environment includes some CVS basics as well as how to organize and keep separate your development and production environments without breaking what works. Another topic discussed is when to use PEAR classes and when to roll your own.

Part II, Caching, is where the book gets hard-core. Once your application works, how do you optimize its performance and scale it so you can have hundreds of thousands of users?

  • You can use static variables to reduce recalculations, and compile your regexps.
  • You can cache data on the PHP level in flat files, DBM files, shared memory, or even in user cookies.
  • There are also solutions outside of the PHP userspace. The ordinary PHP process takes the text which constitutes the programmer's code and compiles into a assembly-style intermediate code. Then the intermediate code is executed. If a script is executed several times without change, the same intermediate code is created, executed, and thrown away several times. A compiler cache saves this intermediate code and reuses it. The author has developed a free, open-source compiler cache.
  • There are also code optimizers, which eliminate dead code and overly-verbose constants.
  • Reverse proxies also work in web sites to reduce network latency. Latency occurs when a server is stuck waiting for a request to be completed before it can execute. A reverse proxy server only collects requests, then hands them off on a high-speed network to the actual server.
  • This can be made even better with content caching. The proxy can determine if the request requires handling by the PHP webserver at all. If a stale, cached copy suffices, it is served instead.
  • Content compression sends your data over the internet compressed. The client's browser is in charge of decompression.

Part III, Distributed Applications, is of big importance to the developer of medium-sized sites. The author discusses the familiar topics of database interaction (including how to troubleshoot your slow queries), authentication, and session handling. Then a chapter on clustering: how to arrange multiple, redundant servers to create a robust, fail-safe system.

The final chapter in this part covers another hot topic: Web Services. Say you want to edit your weblog entries on a real text editor rather than through a web form. If you have RPC (Remote Procedure Calls) set up on your web server, you need only write a script which manufactures a request to a web service and and ships it out. What's the sales rank on Amazon of the book you just wrote? What's the weather like in Medford, Massachusetts today? These are all jobs for web services. XML-RPC and SOAP are approaching the standards state of usage, so using one of these means you don't have to develop your own RPC client or server library. SOAP is even richer than XML-RPC: it's an all-purpose messaging protocol which is in use by many of the big players in web services (e.g., Amazon, Google).

In Part IV, Performance, the author returns to the optimization question. How can PHP scripts themselves be made to run faster? There are several techniques:

  • Use the apache benchmarker or other load-generating programs to determine which requests take the most time.
  • Use a PHP profiler such as the one the author has written to examine your script line-by-line and determine which function calls are most expensive.
  • Use a synthetic benchmarker (such as the one included in PEAR) to analyze small bits of code and discover how efficiently they do their task. Which is faster: interpolation of variables or string concatenation (the latter, at least before PHP 4.3)? If you don't have a library compiled into PHP, can you implement all the functions in userspace efficiently (not really)?

Part V, Extensibility, is for people who want to adapt PHP on the language level for their needs. This part requires a knowledge of C and a strong grip on your hat! After a discussion of PHP and Zend Engine (the virtual machine on which compiled PHP runs) internals, the author shows how to make both simple and complex extensions. You can add new functions to PHP, add a suite of library wrappers, add and manipulate classes and objects, all using pre-defined macros. In the last chapter, you can extend Zend itself to (say) implement all errors as exceptions, create a PHP Shell, an opcode-dumper, or modify the author's compiler cache or profiler.

I very much enjoyed the book. I have chosen to take the plunge into PHP5 for a new web project, partly because this book convinced me it's worth it. I can't imagine I'm going to use everything I've learned from the book, but I'm glad to know how problems like these are solved.

There are a few typos and misspellings, but that's to be expected in such a large book with limited turnaround time. Definitely recommended.

Matthew Leingang is a Preceptor in Mathematics at Harvard University. He continues to try to integrate web development into his day job. You can purchase Advanced PHP Programming: A practical guide to developing large-scale Web sites and applications to PHP5 from bn.com. Slashdot welcomes readers' book reviews. To see your own review here, carefully read the book review guidelines, then visit the submission page.

189 comments

  1. php-embed by SIGALRM · · Score: 5, Informative

    Part V, Extensibility, is for people who want to adapt PHP on the language level for their needs

    This is an often-overlooked advantage in PHP: the ability to use php-embed to run embedded PHP within another application. For example, our company has created an HL7 HIPAA-accelerator in C/C++; we chose PHP as the embedded language in our product--by which users can create custom data transformations.

    The reason? PHP is easy to use, loosely-typed (which is an advantage in our project), fast, and of course, free. It was a great decision.

    --
    Sigs cause cancer.
    1. Re:php-embed by Anonymous Coward · · Score: 0

      has that been adopted as a regular mod, part of PHP5?

    2. Re:php-embed by SIGALRM · · Score: 4, Interesting

      It's not really a mod, just a php_embed.c and php_embed.h which wrap up some TSRMLS functions, not much documentation on it, but a decent thread here.

      --
      Sigs cause cancer.
    3. Re:php-embed by dinodrac · · Score: 5, Informative

      Hmm... A first post that wasn't a troll. I'm amazed.

      I've got a couple database applications using PHP that I've been working on for a while - I wasn't aware that PHP could be easily embedded into a C application.

      Obviously, I'd get better performance with a hybrid of C and PHP code, so this actually simplifies quite a few projects for me. (No more mixing PHP, Perl, C, Python, MySQL and TCL on a single application - yay! ;)

      Thanks for pointing this out..

    4. Re:php-embed by nkh · · Score: 4, Informative

      Why not Lua or Ruby? They can both be embedded easily (and Lua has even been used in Monkey Island 4). Were there other advantages for PHP?

    5. Re:php-embed by SIGALRM · · Score: 4, Informative
      Thanks for pointing this out..

      Sure. One more thing, the zval integration is easy as pie, something like:

      zval *zarray;
      MAKE_STD_ZVAL(zarray);

      if ( array_init(zarray) == FAILURE ) {
      // ... something wrong
      }

      add_assoc_string(zarray, str_name, str_val, 1);

      ZEND_SET_SYMBOL(&EG(symbol_table), str_tokenlevel, zarray);

      Forgive the poor code above, just the way I remember it... I'll email you the php-embed stuff I have in its entirety.
      --
      Sigs cause cancer.
    6. Re:php-embed by Anonymous Coward · · Score: 0

      The reason? PHP is easy to use, loosely-typed (which is an advantage in our project), fast, and of course, free. It was a great decision.

      easy to use? ok, bzt why do i have to type that damned $ every time?) free? of course, but fast? You must be kidding.. ;-)

    7. Re:php-embed by Scaba · · Score: 2, Interesting

      Just on a guess, I'd say there are a lot more PHP developers out there than Lua or Ruby developers (though Lua looks pretty cool). Besides, Ruby developers are all just ex-Pythoneers who thought Python was becoming too popular, and don't really count as developers anyway ;>)

    8. Re:php-embed by Anonymous Coward · · Score: 0

      Besides, Ruby developers are all just ex-Pythoneers who thought Python was becoming too popular, and don't really count as developers anyway ;>)

      I switched to Ruby because I couldn't figure out *why* Python was so popular. My theory: people were so desperate to move beyond the confusion of Perl, they jumped to the first half-baked language that came along, as long as it wasn't Perl and was readable.. Python has moved from half-baked to 5/8-baked recently but while they are fumbling around in the dark I will stick with the gem from Japan.

      Anyway, just because I can crank out full-featured apps in Ruby in a few days and spend the rest of the time with my feet up on the desk reading slashdot, doesn't mean I'm not a developer. ;-)

    9. Re:php-embed by JamesOfTheDesert · · Score: 1
      Just on a guess, I'd say there are a lot more PHP developers out there than Lua or Ruby developers (though Lua looks pretty cool).

      Hmm. Well, I suspect there yet even more VB programers, so sites shouldmbe done in VBScript, no?

      (Yeah, Im trolling.)

      Besides, Ruby developers are all just ex-Pythoneers who thought Python [python.org] was becoming too popular, and don't really count as developers anyway ;>)

      Oh, but you are so wrong! We're really all just ex-Perlers who thought Pythin was becoming too popular for the wrong reasons.

      (Even one who guessed that last comment was a troll, too, raise your hand ...)

      --

      Java is the blue pill
      Choose the red pill
    10. Re:php-embed by Fweeky · · Score: 1

      I switched to Ruby for much the same reason, except my previous language was PHP. Your theory works well for it too; it wasn't special as a language, it just happened to do what people wanted well enough to get popular, at a time when the alternatives weren't hard to beat for the average user.

      I get paid for writing both, and increasingly I'm finding Ruby being my primary language, even for web development; this coming from someone who 18 months ago was a raging PHPhile, defending it from people like me ;)

    11. Re:php-embed by egarland · · Score: 1

      Why didn't you use perl instead of PHP? It seems to have all the advantages mentioned above and I would think it would be better suited to the task.

      I know perl is out of vouge these days but I think it's highly under-rated. Does it have such a bad name that people actually avoiding it for projects that it would be good for?

      --
      set softtabstop=4 shiftwidth=4 expandtab nocp worlddomination
    12. Re:php-embed by Anonymous Coward · · Score: 0
      For an alternative mechanism for easily embedding scripting languages into your C/C++ code check out swig - http://www.swig.org/. I used it a while ago and was well impressed.

      Doesn't do PHP though (offtopic, but useful hopefully, sorry), but from the website:

      The following scripting languages were supported in the final SWIG 1.1 release.

      * Tcl 8.0 and newer versions.

      * Python 1.5 and newer.

      * Perl 5.003 or newer.

      * Guile 1.3.4 and newer.

      The following languages are also supported in SWIG 1.3.6 onwards.

      * Java JDK 1.1 and newer.

      * Ruby.

      * Mzscheme.

  2. most of the books by joeldg · · Score: 4, Interesting

    most of the books don't cover the topics of cli-based php which is unfourtunate.
    Things like php-ncurses and php-gtk or even how to properly debug cli apps and it is strange saying there is a large following of PHP commandline (cli) people out there.

    Anyway, always good to see more books at any rate.

    1. Re:most of the books by Anonymous Coward · · Score: 1, Informative

      Um, all you need to know about using the CLI is on this page:

      http://us4.php.net/features.commandline

      As for php-gtk, there are much better alternatives. And I don't exactly have much faith in something that's developed and supported by only one developer (the cantankerous Andrei Zmievski no less).

    2. Re:most of the books by name773 · · Score: 2, Interesting

      and don't forget sockets!
      i wrote an encrypted chat client/server combo using php exclusively with ncurses and sockets
      source is here

      it's a bit hard to setup, because it was just a for phun project... man php is great

    3. Re:most of the books by tha_mink · · Score: 1

      most of the books don't cover the topics of cli-based php which is unfourtunate. Things like php-ncurses and php-gtk or even how to properly debug cli apps and it is strange saying there is a large following of PHP commandline (cli) people out there.

      And don't forget ActivePHP which is a neat little deal for scripting nice little windows based php apps.

      --
      You'll have that sometimes...
  3. Latest software by Ford+Prefect · · Score: 5, Interesting

    PHP 5? Great!

    I've got a bit of a complaint about computer books, in that they frequently concentrate on the latest and greatest versions and brush aside the older versions - the versions that the majority of web hosts might be running, for instance.

    I was looking for a MySQL book a while back, and there were dozens of them on the shelves in the bookshop, but all based around MySQL 4 - not the ubiquitous MySQL 3 that I was trying to learn. Looking through at all the new features can be a bit dispiriting, especially when you're stuck with the older version.

    Anyone else had similar problems?

    --
    Tedious Bloggy Stuff - hooray?
    1. Re:Latest software by Xiarcel · · Score: 1

      Maybe Amazon used books would help?

    2. Re:Latest software by zapp · · Score: 4, Insightful

      Isn't that why we have used books? Ebay, Amazon, Half.com. I'm sure somewhere you can find a book for an older version of a piece of software.

      --
      no comment
    3. Re:Latest software by wooby · · Score: 3, Insightful

      I know what you're talking about, and you're right: new books are about new software.

      Your point about web hosts is also true; it's difficult to find a PHP5 webhost. It takes guts to run a RC on production servers! However, you can be certain that soon enough PHP5 will become as ubiquitous as 4.

      Anyways, just judging by the review, it seems like this book's intended readers are enterprise programmers: people who will leverage more control over their development platform than the average webmaster.

    4. Re:Latest software by 777v777 · · Score: 0

      I think you are trying to find old books at the wrong store(s). I personally would prefer to see many new books, so that when some new fundamentally different version is out, I can quickly come up to speed on it. The old books are bound to exist, as they used to be the new fancy ones. Perhaps a local library might have old books, or some non-mega-bookstore might.

    5. Re:Latest software by mcrbids · · Score: 1

      not the ubiquitous MySQL 3 that I was trying to learn.

      There are hosting companies that still host PHP3? PHP4 has been out for like FOUR YEARS now...

      I admin my own systems, so I'll be moving to PHP5 as soon after its official release as I can do some regression testing.

      The built-in SQLite is very much reason enough to begin using it with my PHP-GTK based applications!

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    6. Re:Latest software by yerfatma · · Score: 1

      Not PHP 3, MySQL 3. Every externally-hosted UNIX client we've worked with (~10) has been a combo of PHP4 and MySQL 3. I'm counting the days (and there will be a lot of them) until I can use PHP5's XML support and MySQL 4's stored procs/ sub-queries, etc.

    7. Re:Latest software by TastyWords · · Score: 1

      There's no money in backdated books in the eyes of [brick-and-mortar] book stores and publishers (speaking as a former publishing employee). Most people don't realize how cutthroat the computer book market is; particularly when compared to "regular" publishing which has no time barrier(s). "Day and Date" describes when a book is desired to be on the shelf; i.e., a book is on the shelf the same day the software is available for purchase. Many people don't even worry about quality for day-and-date books - they buy the first ones on the shelf. (these folks are not descriminating users, but those who think they need to go through a product step-by-step in order to learn it).
      Big question: "Just how long should they keep older versions and how many of each older version should they keep?" - this is not a rhetorical question - I'm interested in seeing what people think makes good sense from a business sense. And "Well, by making old versions available they're more likely to have my business for new books." That's weak. Seriously: how many for each version and how long for each?

      Like many industries, the Pareto Principle [1] rules: "80% of your revenue comes from your top 20% of sales". So the remaining 20% of your revenue comes from the other (bottom) 80% of your sales. (this is providing you haven't picked products so good you don't have this type of problem.

      Back to purchasing books and used books in particular. First: note that half.com is a spam supporter. If you want to test this yourself, create a spam trap. Create some hotmail account and submit that with a purchase at Half.com. Use that account for nothing else and log on periodically to keep the account active. Next: Bookstores. n.b. nearly every time books are mentioned on /. people say "It's $x on Amazon!" and|or "It's $y on BN!" These are the same jokers who will pay $2.00us/gallon for gas because it's the nearest gas station but driving two blocks further, it's available for $1.75us/gallon (and when you point this out, they claim they didn't look down the street and notice the other station. (so much for being smart enough for programming or observing details enough to find errors, eh?

      Check your local brick-n-mortar stores. Borders piles their outdated books for a song (even if you are tone deaf) on a table - it's cheaper for a sale than dealing with destroying or shipping them back.

      Finally, if you are lucky enough to have a CompUSA (we've got one here in Indianapolis), they've got several hundred titles on some rotating racks which are 25%-75% off the cover price for older versions of software.

      Finally, go to BookPool: Search and Compare among 40+ sites, 20,000 sellers, millions of books! summary: this is an online shopping 'bot which searches 40+ online bookstores. If you supply information, it'll include custom shipping and|or taxes. You can mention coupons. It'll present information in a ascending order (cheapest first) with everything in a table, all broken down. Where do Amazon or BN rank? Near the top, but frequently not the top. You'll find other stores whose price + shipping is less than Amazon's gross price sine shipping - remember, shipping isn't always free for Amazon. So if a store has a book charge + shipping which is less than Amazon cover without shipping, you're getting a good deal.

      If people are willing to limit themselves to Amazon & BN, they can email me with the information and I'll gladly order the books on a cheaper site and keep the difference.

      Okay, you've got lots of help and tools. If you can't find it with anything listed here, well, you must be [xxxxxxxxxx redacted xxxxxxxxxx]


      [1]Pareto Principle: this is the "80/20 Rule" everyone uses but likely doesn't understand 1) there's actually a formal name for it; and 2) it's eponymous (based upon someone's name). You have to be careful about tossing too many terms around [at once] but this is one of those which is nice to inject into a meeting or presentation.

    8. Re:Latest software by electrongunner · · Score: 1

      With the prices of virtual private servers (VPS) these days, there's abosolutely no reason to be held hostage to your web host's old version of PHP if you want to upgrade. Move your server to a $29/month virtual private server and install whatever the hell you want. After a little less than a year of running a VPS from www.dinix.com, I will never go back to cheap shared hosts. So if you can't find a good host with PHP5, then get a VPS account and host yourself! And no, I don't work for Dinix.

    9. Re:Latest software by kwoff · · Score: 1

      Probably in a discount bin for like $5, too.

    10. Re:Latest software by Bitsy+Boffin · · Score: 1

      MySQL 3 is common on shared hosts because there are incompatabilities goign from 3 to 4 that a handfull of older web apps fall prey to.

      Whats worse though is that some 'control panels' (eg Plesk, Ensim as well I think) don't run with 4, or at least come with 3 as the default 'supported' environment.

      There are hosts out there though that are not stuck in the past and do run MySQL 4 now, personally, I wouldn't even give the time of day to a host who runs MySQL 3 and doesn't provide any MySQL 4 server at all.

      --
      NZ Electronics Enthusiasts: Check out my Trade Me Listings
  4. Mysql + Apache 1.x by john_smith_45678 · · Score: 4, Insightful

    Sigh, I really wish these books would get with the times and start using PostgreSQL (or even Firebird) and Apache 2.x (I assume the book uses Apache 1.x since the PHP developers seem so against 2.x).

    1. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Is Apache 2.x usable? I know a year ago, it wasn't really ready for production use. Has that changed? Can we replace all of our 1.x with 2.x?

    2. Re:Mysql + Apache 1.x by john_smith_45678 · · Score: 4, Informative

      I've been told by the Apache crowd that the Prefork MPM obviates any concerns of thread safety in libraries.

      I've been using 2.x for about a year. Zero problems. Performs great.

    3. Re:Mysql + Apache 1.x by PornMaster · · Score: 1

      For database abstraction, George mentions PDO in his blog as a nice solution.

      http://www.schlossnagle.org/~george/blog/archive s/ 260_PDO.html

      -PM

    4. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 1, Informative

      On small tables, MySQL will generally win. However, when you get to very large (100+MB) tables, PostgreSQL kicks the crap out of MySQL. Multiple Select/Inserts as a second will favor PostgreSQL too. Finally, PostgreSQL can handle higher single-server loads.

    5. Re:Mysql + Apache 1.x by mios · · Score: 3, Insightful

      That's not entirely true. PHP itself is threadsafe ... some third party libraries are NOT ... so if you compile some of the third party libraries w/ php, then you might find yourself in a heap of trouble, and you'll find yourself asking WTF is going on here ... So .. the 'official' thing to say would be to use apache 1.x because depending on what you are compiling into php, you just never know. See? The PHP devs aren't so bad after all.

    6. Re:Mysql + Apache 1.x by CHaN_316 · · Score: 3, Interesting

      I think your argument is just a matter of opinion. One could have easily asked

      Sigh, I really wish these books would get with the times and start using SQL Server 2000 (or even Oracle), and Microsoft IIS

      I'm a firm believer of using the right tool for the right job. Some projects I've worked on don't really need foreign key enforcement, and subqueries, and what not provided by PostgreSQL. MySQL has worked just fine in a lot of cases. Some industrial strength applications may need a PostgreSQL. But whatever makes the most sense should be used.

      --
      "There is no spoon." - The Matrix
    7. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 1, Informative

      LOL, everybody we know says the opposite. PostgreSQL definitely wins in the ease-of-use category. Sure there's more to learn, since real RDMS's like PG, Firebird, MSSQL, DB2, Oracle have a lot more features than mysql. MySQL has terribly inconsistant and incompatible SQL, lousy docs, lousy interfaces, worse benchmarks. You're just trolling and obviously don't know what you're talking about (and/or are on mysql-ab's payroll).

    8. Re:Mysql + Apache 1.x by rho · · Score: 1, Interesting
      pgsql fulfills certain needs better than mysql. I prefer pgsql, because I have a lot more experience with it. Often, pgsql is touted for its ACID compliance, which is (usually) unneccessary for Web applications.

      mysql always seemed to me to be a real amateurish production, while pgsql seemed more professional. That's just interpretation, however, and may be influenced by the fact that every half-assed Perl hackery uses mysql as its backend. Guilt by association, I suppose.

      If I were doing something that needed a certain degree of robustness, however, I'd definitely go for pgsql. I'm less terrified of it.

      --
      Potato chips are a by-yourself food.
    9. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Mod parent (-1 bias) or (-1 troll), whichever is available.

      You wouldn't use the word "triumphantly" in that context if you were even remotely interested in a fair comparison.

    10. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Sigh, I really wish these books would get with the times and start using SQL Server 2000 (or even Oracle), and Microsoft IIS

      Since when did those databases become open source and free (which mysql may or may not be, depending on how they try to twist their shady licensing tactics). Last I checked, slashdot was about (F)OSS - PHP, PostgreSQL, Apache, Linux, ...

    11. Re:Mysql + Apache 1.x by Percy_Blakeney · · Score: 5, Informative
      I can't think of a single reason to prefer PostgreSQL over it, in fact.

      I used to think that, until I realized that my programs were twice as complicated as they needed to be due to MySQL's lack of typical relational database functionality. Triggers, views, sub-selects, user-defined functions, transactions, templates... the list of PostgreSQL advantages (feature-wise) over MySQL is long.

      MySQL is now trying to catch up to PostgreSQL in the feature category, but is still not even close. That's not to say that MySQL is worthless -- quite the contrary: if you want an indexed file system, MySQL is the way to go. On the other hand, if you want a good, open-source relational database, PostgreSQL is a champ.

      Ease of use pushed us away even before we looked at benchmarks, which are all triumphantly in MySQL's favor.

      PostgreSQL is a bit harder to initially set up, when compared to MySQL. On the other hand, it isn't rocket science; it is still pretty simple.

      In terms of benchmarks, you might want to notice that MySQL is hardly "triumpantly" winning normal benchmarks. Take a typical MySQL table (MyISAM) and try doing lots of concurrent reads and writes. You'll find that MySQL's habit of locking the entire table on writes really is a downer when it comes to performance.

      Another thing to note is that MySQL has placed their libraries under the GPL, making them somewhat incompatible with the PHP license. This has caused a bit of a rift in the PHP community, with the result being that MySQL will probably be less supported by the PHP developers while PostgreSQL increases in support.

    12. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      People are really started to take notice of PostgreSQL:

      Sterling Hughes' Blog
      PostgreSQL
      I've been seeing a lot of interest in PostgreSQL lately. Maybe its just the crowds I travel in, but the "buzz" reminds me of PHP right before it really took off. The database has a really good architecture, and the features are maturing nicely (Slony-I is looking sweet) I know that if I had a choice, I would currently look at PostgreSQL before I went on to evaluate other options.

      The community is also very appealing. PostgreSQL is "Free as in BSD," and not developed by any one company - it is a true community project, and while there certainly is a meritocracy, there seems to be many ways to "get involved," including one of the best maintained TODO lists I've seen.

      Keep your noses out, PostgreSQL hasn't gotten a lot of media attention or momentum to date (relatively speaking), but I have a feeling two years from now things are going to explode...
      http://edwardbear.org/serendipity/archives/1216_Po stgreSQL.html

      Even slow-moving dinosaurs like Jeremy Zawodny

    13. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Not familiar with PDO. Been using adodb and it's been working well.

      http://adodb.sourceforge.net/

    14. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      I've been using postgres and apache2 with php4 for the last 6 months and have never had a hiccup. Runs quite smoothly.

      I think the only advantage to mysql vs. postgres with php has been phpMyAdmin. However, the new version of phpPgAdmin has come a long way in closing this gap.

    15. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Or just stick with the prefork Apache2 MPM, and you don't have to worry about whether or not the libraries are threadsafe. It only matters for the worker and perchild MPMs, which are not the default on *NIX anymore for that very reason.

    16. Re:Mysql + Apache 1.x by Mr.+Slippery · · Score: 1
      I can't think of a single reason to prefer PostgreSQL over it, in fact.

      Until recently, MySQL was not a relational database (non-ACID). It has added features to meet that goal, but if you value the integrity of your data(!) I suggest sticking with something that's been a real database for a lot longer - PostgreSQL.

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
    17. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Yes, phpPgAdmin has been enormously improved in the past 1-2 years. It's getting pretty comparable to phpMyAdmin. Huge kudos to Christopher Kings Lynne for resurrecting it.

      http://phppgadmin.sourceforge.net/

    18. Re:Mysql + Apache 1.x by ahodgson · · Score: 5, Informative

      The major performance advantage MySQL claims over PostgreSQL in real world use is small queries executed in a primarily read-only environment. MySQL also performs deletes and updates very fast, in a single-user environment.

      Locking issues cause MySQL to slow down greatly when the database is shared between readers and writers. In fact, any significant amount of concurrent write traffic has, IME, always caused MySQL to deadlock.

      My own testing showed that MySQL, on a dual P4-2.4 with PHP could deliver about 630 pages/second with 1 very simple query per page. PostgreSQL delivered 480 pages/second with the same page. This is MySQL's optimum environment and it only beat PostgreSQL by 31%. Certainly something to consider, but hardly earth shattering.

      Since PostgreSQL is so much more capable in every other way, it wasn't hard to decide to move everything to PostgreSQL.

    19. Re:Mysql + Apache 1.x by pjay_dml · · Score: 1

      I like to compare the situation, with that of hammers and their use.

      There are probably more hammers out there, than we have DB's on offer.
      hammer==database

      So, let's take the 'dead blow' hammer, you wouldn't use it to nail the wood structure of your house together. Well, you might, BUT it's gonna be a pain.

      Now we can take MySQL and use it for developing an app, that is dependent on a strong relational database. Well, you can do it, BUT...see above!
      What the parent poster should rather be asking for is: "Where is my PHP+PostgrSQL/PHP+firefox book?". Such a request makes a lot of sense, and is something that the market is really missing.

      After all, it is a book about PHP, the database used, is just to illustrate PHP's capabilities. MySQL is just a far better choice for demonstration purposes, using a SQL syntacs.

      Enough said?!

    20. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      I used to be a big fan of mysql, and hated postgresql. Then I actually had to use pgsql for a project that required a real database, and now I can't stand mysql. Even little things like how shitty the mysql shell is make a big difference, nevermind how much more stable and feature complete pgsql has been.

    21. Re:Mysql + Apache 1.x by tcopeland · · Score: 2, Informative

      > if you want a good, open-source
      > relational database, PostgreSQL is a champ.

      Right on. Good utilities are available for it, too!

    22. Re:Mysql + Apache 1.x by Unordained · · Score: 2, Insightful

      Perhaps part of what the grandparent is trying to point out is that a lot of the /.-related culture revolves around LAMP. That's fine as long as that's actually the best tool for the job -- but people get stuck on things, and if never exposed to other tools won't recognize the better tool when they see it.

      So really, it's not so much that we need more Firebird/Postgresql in books because they're better, it's to make sure that the audience gets a bit of everything. MySQL might be seen as a "teaching database", but you don't see programming books exclusively explaining things in terms of Pascal code, assuming you can translate to other languages if you know them. I think it'd be useful for the writing community to make an effort to marry random-seeming technologies together, if nothing else to demonstrate that none of the technologies are weak or narrowly-applicable. I doubt we'll see that though.

      Someone else pointed out that web apps rarely need the full integrity and concurrency support of a more featureful database server. Is it that attitude that gives web apps the "toy" reputation they have?

      On another note -- unlike most programming languages, MySQL is a commercial operation and the quantity of books focusing on using MySQL probably has something to do with its commercial success. Free advertising? (Must I remind people that unlike MySQL, Firebird and Postgresql are both free-even-in-commercial-circumstances? The same would apply to all linux GUI books focusing on Qt rather than other visual toolkits.)

    23. Re:Mysql + Apache 1.x by snillfisk · · Score: 0

      Another thing to note is that MySQL has placed their libraries under the GPL, making them somewhat incompatible with the PHP license. This has caused a bit of a rift in the PHP community, with the result being that MySQL will probably be less supported by the PHP developers while PostgreSQL increases in support.


      This cause quite a stir earlier and caused the MySQL4 API to be not bundled at all. This was however addressed by MySQL AB and exceptions from the GPL was put in place for several Open Source Licenses, including the PHP License.

      Read more about it here.
      --
      mats
      One man's ceiling is another man's floor.
    24. Re:Mysql + Apache 1.x by Percy_Blakeney · · Score: 1

      From what I understand, PHP 5 will not include a bundled version of the MySQL libraries, with the licensing issue being one of the causes. MySQL finally granted exceptions to some licenses (PHP included), but the whole argument turned some people off to MySQL. Of course, this doesn't mean that the MySQL API is not supported, it simply means that you'll have to install the MySQL libraries separately before you can build PHP 5 with MySQL support.

    25. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Uhhhh, they're not against Apache 2... in fact, some of the PHP developers are Apache developers too!

      The only problem with php and apache 2 was being thread safe... and they fixed that in like php4.3... however, some php extensions aren't threadsafe yet so that's why there isn't some blanket compatibility statement yet.

    26. Re:Mysql + Apache 1.x by yerfatma · · Score: 1

      I upgraded here at home to start using Subversion and I've yet to see a problem with PHP or anything else.

    27. Re:Mysql + Apache 1.x by Decaff · · Score: 1

      I can't think of a single reason to prefer PostgreSQL over it, in fact.

      There are no subselects in production release of Mysql. (version 4.1, which has this in, has been a very long time coming out). Lots of aspects of SQL are present only in different table types in Mysql; its not consistent. PostgreSQL is far easier to manage: You get ACID, PL/SQL, full SQL and speed on all tables.

    28. Re:Mysql + Apache 1.x by Tony-A · · Score: 1

      if you want an indexed file system, MySQL is the way to go.
      Many times that's exactly what you really want.

      Take a typical MySQL table (MyISAM) and try doing lots of concurrent reads and writes. You'll find that MySQL's habit of locking the entire table on writes really is a downer when it comes to performance.
      MySQL has a habit of always saying how long it took to do a query. This isn't bragging. It's telling you how long it had things tied up. As long as everything fits into the available time, MySQL will work beautifully. Try to do too much at the same time and you get a traffic jam, just like with real traffic. Slow readers and fast updates means you want to use something else.

    29. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Except that mysql is so far out of whack with SQL standards and so kludged together that it's more like a crude rock than a hammer. ;)

    30. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      LAMP: Linux Apache Middleware PostgreSQL - Building a Brighter Lamp.

    31. Re:Mysql + Apache 1.x by mbyte · · Score: 1

      MySql has one huge advantage over postgresql: ease of administration. creating DB's is dead end easy, the tables are plain files inside directories. Upgrades don't need dump/restore (new postgresql comes out -> time do dump/restore your 5 gb db ...)

      For hosting companies that is the killer feature, easy to install, easy to administer -> easy to sell ...

    32. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      But tons of people (me) get started using mysql cause that's all anyone uses or talks about, and then only a couple years later do they use postgres, and realize that even for trivial things that don't need all of pgsql's features, its just plain much nicer to use. If people would stop giving the mysql corporation free advertising for their non-free product, and show postgres it would be great for newbies just starting out. We could do things the right way, instead of learning bad habits and having to unlearn them when we find a real db later on.

    33. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      How ignorant you are. Creating db's is "dead easy" in postgresql as well. Doing a "pg_dump_all" then a "psql dump.sql" is really that hard? If you think so, I hope nobody is letting you anywhere databases.

      Mysql is a fucking pain in the ass. Upgrading (not to mention admining and repairing) the huge array of table types they've kludged into it is a nightmare.

      Postgresql is ridiculously easy to install as well.

      So, shut the hell up you stupid ignorant troll.

    34. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      So true. There's a huge mysql bandwagon that's taking advantage of ignorant newbies. True again that using mysql people learn horrible practices.

    35. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      Sigh, I really wish these books would get with the times and start using SQL Server 2000 (or even Oracle), and Microsoft IIS...I'm a firm believer of using the right tool for the right job.
      Like using a sharp stick to poke yourself in the eye.
      You mean you should get with the times. IIS is not common on the net and falling according to netcraft. Most machines are running apache. Why you want to continue to pay tribute to M$ for a bug ridden products is beyond me.

    36. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0
      ...I used to think that, until I realized that my programs were...

      I used to think what you think now too. I switched a bunch of stuff over to postgre and I was a bit apprehensive about that vacuum BS but I figured I could deal with it. Big mistake man! The next time I upgraded postgree with RedHat's distro upgrade, I was hosed big time! I had thousands of tables or around 1 terrabyte worth of data in it. All of it now useless to me. I had to restore it and restore to the previous version, dump it, upgrade AGAIN and reload everything. It took me about a week to do that. On the other hand I still have another database with about the same amount of data in it with mysql. I have never had a problem. It always works and works well.
      There were also the other little incidentals with postgre that made it infuriating to use. So the first thing I try to do is delete it wherever it shows its ugly head.

    37. Re:Mysql + Apache 1.x by Anonymous Coward · · Score: 0

      I think the parent is just illustrating that you can argue what web server / database you like ... until the cow comes home, and in the end it really doesn't matter. It's just a matter of opinion. Every tool has its place.

    38. Re:Mysql + Apache 1.x by scrytch · · Score: 2, Interesting

      > Some projects I've worked on don't really need foreign key enforcement, and subqueries, and what not provided by PostgreSQL

      MySQL not supporting foreign keys is just fine. I just wish it would stop PRETENDING to support them by parsing and subsequently IGNORING foreign key declarations.

      MySQL's documentation has typically heaped scorn on everything they didn't implement that version, then the attitude suddenly disappears when they do get around to implementing it. It strikes me as an astonishingly unproductive attitude, to say nothing of unprofessional. Go grab an old mysql rpm (with docs) or grab the docs out of the wayback machine if you want to see for yourself.

      Incidentally, MySQL's speed comes mostly when using the MyISAM driver. Hope you weren't wanting a database larger than 2 gigs. I can and do fill up that much in a day with my postgresql db.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
  5. Apache2? by Phantom+of+the+Opera · · Score: 2, Informative

    The early versions of Apache 2 really scared a lot of people away. It scared me away. Switched to Apache 1 and things started working again. Now that doesn't excuse my poor skill in the sysadmin realm, but I would doubt I am the only one who had headaches with 2.

    -Phantom

  6. Re:Advanced PHP programming by imroy · · Score: 5, Funny

    I think we can add this title to the list of contradictory terms:

    • Military intelligence
    • Microsoft Works
    • Advanced PHP programming

    :)

  7. I still remember by Jason+Hood · · Score: 2, Funny

    that onion article titiled "Student arrested for suspected use of PHP" ...and rightly so ;)

    --
    Are you intolerant of intolerant people?
    1. Re:I still remember by MonkeyCookie · · Score: 2, Funny

      I couldn't find an Onion link to this story, but it is on a number of other sites.

      Here's a link to one.

    2. Re:I still remember by ivansanchez · · Score: 1

      Yep, it's still there.

    3. Re:I still remember by amacedo · · Score: 1

      The reason why no one will find that article at the Onion is because it isn't an Onion article. Brian Brigs wrote it in his site bbspot.com.

      Just setting the record straight.

  8. Re: Against Apache 2.x? by Anonymous Coward · · Score: 5, Insightful

    This seems to be a really common misconception among readers of slashdot. The truth is this:
    - PHP developers are not opposed to Apache 2.x.
    - PHP is stable on Apache 1.3 _AND_ 2.x.
    - Apache 2.x has a large number of new features designed to better handle high volume sites (with or without PHP)

    MySQL is still the standard web-hosting provider database backend, that is why most books cover it. mySQL is very similar to other SQL dialects. If you understand SQL, PostgreSQL is easy and you shouldn't need explanation on how to run queries from PHP. The books focus on PHP, not the SQL languages... if you want to learn about SQL, get a SQL book.

  9. Re:Huh!?! by vijaya_chandra · · Score: 0

    AC you are 100% correct but

    Real programmers code in 0s and 1s

    (Karma be damned! I am no better than an AC anyway)

  10. Re: Against Apache 2.x? by john_smith_45678 · · Score: 1, Informative
  11. "Advanced" PHP ? by bunnyman · · Score: 5, Funny

    Isn't that called "Perl?"

    1. Re:"Advanced" PHP ? by TekZen · · Score: 1, Troll

      Yeah, so that instead of having a real object model (as in PHP5) we could follow programming standards and use keywords like "bless" (in Perl).

      -Jackson

    2. Re:"Advanced" PHP ? by jaylee7877 · · Score: 1, Funny

      Perl: PHP for the masochistic.

  12. Re:Huh!?! by Anonymous Coward · · Score: 0

    you should move to assembly, spend a week building a tcp stack and a web server that echoes HelloWorld to show the lazy scripting lazy users, who don't spend more than a minute for something like this, the coolness factor of doing everything on your own.

    Except that the languages the Colonel mentioned don't make you do everything yourself. Perl's got the CPAN which has all sorts of goodies already created for you. Ruby's got the RAA and Python's got something similar.

    I know that Ruby's got a webserver that comes with it: Webrick. You can create a webserver in 1 line of code. You can do similar things with Perl's Mason, too, I believe.

    So, nobody's saying move to assembly language. If anything you should move in the opposite direction.

  13. Advanced PHP by Deltawolf · · Score: 3, Interesting

    This book seems like a friendly addition to the many 100s of php books already out there. I have bought many php books and they all seem to go over the same thing, syntax and functions. But this book from the description seems to do more than simply explain functions and syntax but also usability and practical use. I am a php programmer myself and much of the problem of coding programs is high volumes of data and usage. By using a code cache system outlined in this book it would definatly allow many good programs that are out today to be used on a larger scale. I know a bulletin board I coded a year or two back could have used this, it choked at 1000 or so users at once. PHP5 is coming and it looks to me like a force to be reckoned with. While you naysayers who code perl, c, and other languages put down PHP as a pathetic language, PHP5 should be getting on par with perl and other languages.

    --
    -Rights? What rights?
  14. Maybe around 5.3 by electricdream · · Score: 2, Interesting

    I'm thrilled to death that PHP is finally starting to catch up with the rest of the world. A solid XML interface, SOAP support, and OO like behavoir are great steps toward a modern programming language. However after my experience in with the PHP 4 I won't be upgrading anytime soon. Can't deal with the constant configuration changes, changing function behavoirs, bugs, and generally moving target of a language.

    Don't get me wrong I love the current state of PHP for developing small fast websites. But if history is a good teacher then PHP 5.3 will be the release which should have been called PHP 5.0. Good luck to those adventurous souls who will be running 5.0 on production servers. I hope you can tell me the dev community has grown up and stablized their dev cycle and that I can upgrade at 5.1 instead of 5.3

    --
    -- force and mind are opposites; morality ends where a gun begins ayn rand
    1. Re:Maybe around 5.3 by Anonymous Coward · · Score: 0
      Can't deal with the constant configuration changes, changing function behavoirs, bugs, and generally moving target of a language.

      That's an insightful comment - I'd mod it up if I had mod points. Stability is one of the most important characteristics of a language. Take C++, for example: glacially slow evolution, nothing has changed in the last 6 years except that STL implementations have become rock-solid. Of course, C++ is not the right language for everything - an interpreted, higher-level language has real benefits. What I'd like to see is:

      • An interpreted language (like Perl/PHP/Python
      • Hi-level (like the above)
      • With a clean, orthogonal design
      • With the stability of C++
      PHP definitely isn't it.
  15. Re: Against Apache 2.x? by Anonymous Coward · · Score: 1, Informative

    mySQL is very similar to other SQL dialects.

    Um, no. Not even close. Check out all mysql's gotcha's and deviations from SQL standards:

    http://sql-info.de/mysql/gotchas.html

  16. Quit your elitist bitching by PeeAitchPee · · Score: 5, Insightful

    There are times when to use a strongly-typed, "true" OO language like Java or C++ and times to use a scripting language like PHP or Perl. Part of being a good programmer is being smart enough to use the right tool for the right job. If you want to torment yourself by over-engineering a small- or mid-sized website in EJB, go for it, but respect those who like being able to get stuff up quickly and easily, with a minimal learning curve. And YES, it is possible to build secure web apps in PHP, despite what you may have heard.

    When you've only got a hammer, everything looks like a nail.

    1. Re:Quit your elitist bitching by Decaff · · Score: 1

      There are times when to use a strongly-typed, "true" OO language like Java or C++ and times to use a scripting language like PHP or Perl.

      There is no reason why you should not use scripting *and* Java at the same time. If you use Jython, Groovy or BeanShell you have all the flexibility of scripting combined with access to the full APIs, security and scalability of Java. If you use BeanShell, you can easily convert your scripts into compiled Java source code if that becomes necessary.

      Part of being a good programmer is being smart enough to use the right tool for the right job.

      Part of being an experienced programmer is realising that switching tools all the time is a bad idea. It prevents code re-use and results in duplication of effort as the same thing is re-written in different languages by different people in different projects.

      If you want to torment yourself by over-engineering a small- or mid-sized website in EJB, go for it,

      No sensible developer would go anywhere near EJBs for a small or medium website. The EJB part of J2EE is for scalable and clustered high-end applications. Other parts of J2EE, such as JSPs and Servlets are lightweight and easy to use.

    2. Re:Quit your elitist bitching by Tablizer · · Score: 1

      Where does this impression come from that strong typing is better for larger projects? There is no scientific evidence or clear-cut argument for that claim.

  17. Aw, Crap by Crinos · · Score: 2, Insightful

    Atkins-Approved? What the crap is that?!

    (I know what it means, but what is it doing here?)

    --
    The Sacred Chao says, "MU".
    1. Re:Aw, Crap by Anonymous Coward · · Score: 0

      The Sacred Chao says, "MU".

      Hail Eris! All Hail Discordia! Fnord.

    2. Re:Aw, Crap by pjay_dml · · Score: 1

      Give the guy some credit. He was just trying to add a little suttle humor to his report (bread - atkins/going over allready covered and understood - reading this book).
      What is it doing here?
      What are you doing HERE?

  18. Language Bashing by sfhc · · Score: 4, Insightful
    I wish people would get over language bashing.

    The issue is not weather PERL or PHP or C is better than the other.

    Languages are just tools. Writing good software is a reflection of one's ability to plan, use OOP, and troubleshoot code, just to name a few.

    When faced with a problem that needs solved, you examine the problem, and select the most appropriate tool(language) to get the job done, and hopefully you apply good software writing skills to the solution.

    Even if you think PERL or something is so much better than PHP, but you suck at writing good software, your software is going to suck.

    1. Re:Language Bashing by Anonymous Coward · · Score: 0

      Writing good software is a reflection of one's ability to plan, use OOP

      OO SUCKS! Fun 90's fad, but let's move on now.

    2. Re:Language Bashing by Anonymous Coward · · Score: 0

      The issue is not weather PERL or PHP or C is better than the other.

      Agreed. This issue is that you mis-capitalized Perl and chose the wrong whether.

  19. I have a problem with PHP's scope by randallman · · Score: 5, Insightful

    PHP was originally developed to make web programming easier in the same way Bash makes certain operating system tasks easier. PHP:Web::Bash:OS.
    PHP5 is impressive, but it appears to be trying to change its scope and here is why. Like Bash, PHP is a big time saver for small programs, but is more difficult to write and maintain as the program gets larger and more complex. The features added to PHP5 will let it scale better, but it will lose its Bash-like advantages. It is trying to move into the arena with Java, ASP.Net(?Maybe), Python, Ruby, ... The problem is you can't have both Bash-like scriptablity and Java-like power/maintainability. So PHP will take the road of Visual Basic -> VB.NET.
    After seeing MY limits with PHP I moved to Python although I still use PHP for simple web scripts. In my opinion, PHP5 is a new language in an old arena. You should choose the right tool for the job, and if you need the new features in PHP, have a look at a powerful, weathered language like Java, Python, or Ruby, or (add your language here).

    1. Re:I have a problem with PHP's scope by waynetv · · Score: 2, Insightful

      PHP5 does not lose the Bash-like advantages of the language.

      For purely procedural code, PHP5 is EXACTLY the same as PHP4. The only changes have been in object-oriented side of things. And even most of those changes are optional.

      Furthermore, the OO changes to PHP5 bring it in-line with other languages. Ultimately it should make it easier for developers familiar with OO programming to get into PHP.

    2. Re:I have a problem with PHP's scope by bigusputicus · · Score: 1

      The languages you suggest Java, Python, Ruby... take a look at their beginings, their original purpose, functionality, implementations, and I think your perspective of PHP may change

  20. Re: Against Apache 2.x? by Mr.+Slippery · · Score: 4, Informative
    If you understand SQL, PostgreSQL is easy and you shouldn't need explanation on how to run queries from PHP.

    You ought to be using PEAR's DB class anyway, which abstracts away most of the differences in dialect.

    --
    Tom Swiss | the infamous tms | my blog
    You cannot wash away blood with blood
  21. Re:Advanced PHP programming by Anonymous Coward · · Score: 0

    Next in the series:

    Advanced BASIC programming

  22. I have a problem with your project's scope by Anonymous Coward · · Score: 0

    If you have more trouble writing and maintaining large applications in PHP than in other languages, perhaps it is a design flaw in your project.

    If you had started out with good design patterns in the first place you probably wouldn't have this problem.

    I've worked on some pretty big projects in PHP, Perl, and Java, and I've seen all 3 done well, and all 3 done poorly.

  23. I enjoyed this book by billybob · · Score: 3, Informative

    I'm about 3 months into a ~5-6 month project in PHP. I had never done anything nearly as complicated as I am now, but I have done a lot of PHP programming. Mainly things that took 2 weeks or less.

    I bought this book near the beginning of my current adventure and I learned a lot from it. It's not the typical PHP book that just mirrors the php doc web site. There's a lot of great information in there. I'm still on PHP4 but that doesnt matter, the concepts still apply.

    Thumbs up! :)

    --
    Joseph?
  24. Good for SysAdmins too! by LojaK · · Score: 5, Informative

    I am a sysadmin by profession, working at a mid-sized ISP in Toronto. I chose to be a sysadmin because I don't really enjoy programming -- but the nature of the job dictates that I code to improve efficiency or functionality. Recently I had to work on an in-house web application, and I chose to do it in PHP, but quickly found that the relatively small webapps I've worked on in the past were not much preparation, so I bought this book..

    To borrow a phrase, "in a nutshell", this book is excellent! Some of it is beyond my skills at the moment, but I appreciate every bit. The author covers OO in a way that I understood, and presented real-world solutions that helped me understand. But, IMO, the best part isn't the PHP, it's the operational theory -- the real problems that sysadmins and web programmers face with large websites, caching, load-balancing, scalability. This made the book worth the $80CND I paid for it.

    I highly recommend it!

    -- Steve.

  25. But how to decide? by Fiz+Ocelot · · Score: 1
    How am I to decide what to go with for a web application which has the potential to grow quite a bit? I'm under the impression that going with something like Apache+Tomcat+Struts+databaseOfChoice and using java servlets would be a better platform than just PHP. Or at least it would be more modular and easier to plug in a web based or rich front end.

    Or I'm just thouroughly confused.

    1. Re:But how to decide? by bigusputicus · · Score: 1

      99% of all web sites can be developed using scripting languages such as Php, Python, Perl, Asp.NET VB.NET and should be done in these languages
      You'll save so much time and effort!
      From a commercial perspective, we'll see many more companies developing with script technologies because time to market is so critical and the script languages are making alot of improvement. As per a previous post, most decision makers in commericial companies will make a safe decision... Java or C#. They are doing this because they've got to market their project internally, so they can say things like, scalability, extensibility... which are are part of the marketing hype from the Java and C# vendors

    2. Re:But how to decide? by bigusputicus · · Score: 1

      Ahh.. and I forgot to add that departments in commerical companies have budgeted for engineers/programmers in specific technologies based on what they are selling/telling their customers. So the customers have been led to believe (i.e marketing/sales) that they need the things (security, exstensiblity, scaleability) that their technology (Java, C# provides). And the customer purchasing the solution needs to sell their choice to their decision makers, and they give the same song and dance and everyones happy. Whats wrong with this picture... Most are not able to accurately define how much security, how much extensibility, how much scaleability... Even when all is known, buying decisions and technolgoy decisions are often emotional decisions.

    3. Re:But how to decide? by Anonymous Coward · · Score: 0

      I am a big believer in interpreted dynamic languages (my favorite is Ruby). PHP is a dynamic language though you can't really push it as far as Ruby or Perl, it does let you work a lot faster than Java.

      And with PHP5's type hints and real exception handling (yay), you get a lot of the goodness of Java, but 100% open source, and no compiling needed.

      So my recommendation is to almost always use PHP (and some kind of struts-like framework, though a really good one hasn't emerged yet, you can always roll your own) for all but the most complex (10 or more developers for instance) projects.

      The complexity of Struts and servlets and so on is SO high. J2EE is a nightmare as well. For 95% of projects you never need that kind of loosly-coupled design.

      I'm also VERY eager for the release of Rails (a Ruby app framework) which looks to be a highly pragmatic and dynamic version of Struts. I'll probably use some of the ideas in my PHP code, where the language allows.

  26. No it isn't. by Anonymous Coward · · Score: 0

    PHP is *very* slow. You would be much better off using ruby or python or pike. Not only are they faster, but they are better suited to non-web apps.

  27. Re: Against Apache 2.x? by tcopeland · · Score: 1

    > Apache 2.x has a large number of
    > new features designed to better handle
    > high volume sites (with or without PHP)

    Yup. We run Apache 2.0 with mod_jk and mod_php on SemWebCentral;, no problems.

  28. Making fun of php? by -noefordeg- · · Score: 3, Insightful

    I see a lot of posts making 'fun' of PHP/Apache/MySQL. Especially things like large scale applications, hard/difficult maintenance on larger projects and not good at scaling.

    Well. That might be true.... For those few sites which actually DO require 'scalability', easy maintenance when the project get bigger and the target is millions of hits per hour/day for some really heavy computations and what-not.

    But there are SO few of these projects around. So for all of you who thinks php stinks at least try to use the right tool for the right job. From my experience in web-application development in Norway almost every large software company will recommend some closed source, inhouse made, 'superheavy' application for whatever site you want to have. They will use every argument you post here to put their software in a better light than some 'light weight solution' like PHP/Apache/Linux/MySQL/postgresql.
    Seriously, almost no web-sites in Norway targeted at norwegians will ever require 'large scale' solutions. There simply aren't enough people around. Still the companies will push forth their solution on unsuspecting customers.

    I had a e-commerce site I made (using php/apache/mysql, python/perl for backend functionality running on TSLinux), reviewed by a respected IT-consultant company in Norway (Bekk - http://www.bekk.no/). Their conclusion was that it was a good solution, well written, but.... "It should have been made in a java/C# or something like that" Why? Because of scalability.
    It's just absurd. They really don't take into account the target marked for the solution. And the current system setup is running just fine and dandy without any trouble. Should the number of visitors increase ten-fold (which it never will), well... Add some slave database servers and more webservers.
    Suddenly you have the board of directors going: -Uhm, why didn't you write the system in Java. We hear Java is a good thing. Java is scalable. Java is more secure.
    Why? Because it took me such a impossible short time to make the site with php and it's been going for 2 years now, without problems. That's why.
    The solution they would have otherwise chosen would be 10-100 times more expensive, would require expensive servers and would probably take years to develop.

    1. Re:Making fun of php? by agwis · · Score: 4, Insightful

      "It's just absurd. They really don't take into account the target marked for the solution. And the current system setup is running just fine and dandy without any trouble. Should the number of visitors increase ten-fold (which it never will), well... Add some slave database servers and more webservers. Suddenly you have the board of directors going: -Uhm, why didn't you write the system in Java. We hear Java is a good thing. Java is scalable. Java is more secure."

      I've encountered this a few times myself but I have a different view point on it. I agree that many sites will never grow enough to worry about scalability but the one thing that does almost always happen is new features being added.

      I've personally seen a few PHP sites that run flawlessly but they are not easily extendable. They are written in such a manner that developers are afraid to work with it because it's too easy to break stuff, or adding new features will involve rewriting big chunks of code. I will admit that I've seen this in other programming languages as well such as .asp and .jsp/java.

      If you consider programming styles such as struts, cocoon, webwork, etc. which encourage the MVC pattern it makes huge difference in the maintainability of web applications down the road. I find that java applications tend to use either these types of frameworks or custom ones that follow the same idea while I find many PHP applications are more like spaghetti code that do work fine but are a nightmare to add to in the future. They are quickly built but the lumping of PHP code in HTML makes it hard on projects where designers need to update the look and feel of a website but have no idea how to change their pages without mucking up the code.

      I'm not saying that is the case all the time but what I am noticing is that PHP is gravitating towards OO programming and seems to be encouraging the separation of business logic from presentation logic, which is a very good thing. The argument that PHP is not as scalable as Java really should be more like PHP is not as extensable or maintainable as Java, but this certainly seems to be changing for the better.

    2. Re:Making fun of php? by Anonymous Coward · · Score: 0

      I worked on a project at Sun that was implemented in Java, it took 12 people 5 months to do what one seasoned Php developer and one C developer could do in 2 months.

      So many companies choose the wrong technology for the wrong reasons... Why... the decision makers play it safe, their butts are on the line so they go with the marketing hype.

      This behavior is changing though! Cost and time to market are driving more people to scripting languages... specifically the web based world!

      One reason .NET will do so well is ASP.NET and VB.NET

      Sun had a change to make Tcl their scripting language for Java, but it was poooh-poooh, Ousterhout left and Sun is still struggling on how to bring the web/app scripters into the fold

      Look at how many companies got suckered into developing with the Java platform and are no longer in business... Application performance until just recently was horrible!

    3. Re:Making fun of php? by globalar · · Score: 1

      The problem is perception.

      Even developers are subject to it's pressures and allures sometimes. Who wants to pass up something "enterprise-grade", scalable, industry supported, etc. for something that amatuers might use? How can you call yourself a professional when you don't use the best?

      It's all relative to your task. Of course, that might be so obvious as to not warrant hiring a consultant.

    4. Re:Making fun of php? by Anonymous Coward · · Score: 0

      You hit it right on the head.

      The shop I work at, we use PHP and VB (shush you naysayers!) because it works great for our goal.

      The clients love it at first but when we have to "sell" it (figuratively) to the IT department they are always complete arseholes. Basically they don't want any VB code running on any of their machines and they think PHP is a toy. What they think is echoed up to their boss who is the one with buying power.

      If we can't sell it to the IT department then we can't sell it at all... its a sad truth.

      I have a great idea for a project on my own that would probably work great in PHP but the only problem is the scale of it (where it will be running) deems that I need J2EE and friends :(

      Oh well, does anyone know good JSP books? I already know a fair bit of Java...

    5. Re:Making fun of php? by smallguy78 · · Score: 0

      I've found c# is about 10 times more productive than PHP for developing, even compared to tools like phpedit. MS is lightyears ahead in terms of developer tools - debugging, intellisense, remote debugging, all the addins for vs.net, fx cop etc. This is after using php on and off, 9-5 for 3 years.

      --
      Nothing costs nothing
    6. Re:Making fun of php? by -noefordeg- · · Score: 1

      "I've personally seen a few PHP sites that run flawlessly but they are not easily extendable. They are written in such a manner that developers are afraid to work with it because it's too easy to break stuff, or adding new features will involve rewriting big chunks of code."

      You are 100% correct here. :-/ PHP can be bad because it's so easy to write really really low quality code making it hard to later add more features or for 3rd party programmers to add/use the code. But that is possible in other languages too and it is avoidable in PHP4 and even more so in PHP5 (I think and hope. Just started looking at PHP5.) But I believe it's not enough of a problem to invalidate the points I tried to make in my first post. Since it's a universial problem for whatever language you use. A company is just required to put some more effort into forcing the developer to do it the 'right way' from the beginning.

      Conclusion might be that for any system/language you choose to use, you should follow coding and development 'standards' which are easy for others to follow/learn. Don't just 'hack&slash' something together.

    7. Re:Making fun of php? by Laebshade · · Score: 1
      Should the number of visitors increase ten-fold (which it never will), well... Add some slave database servers and more webservers.


      Post the url of the website on /. and you will be proven wrong :)
    8. Re:Making fun of php? by Anonymous Coward · · Score: 0

      Do consider for a time what drives the folks who rail against PHP: the opposite of your situation, that is being made to write an industrial strength app in PHP. These apps take real time and real resources to spec, design, develop, document, test, deploy, and maintain. There's ways to shorten this cycle (XP, "prototyping" languages, etc) but ultimately no getting around it. Then PHP evangalists come around and say "I could whip that up in no time in PHP". Well yes, they probably could ... could they also make sure it's fully localized? How about error reporting and recovery? On a distributed session.

  29. Re:php-embed--troll/rant by Anonymous Coward · · Score: 0


    The profound weakness of F/OSS is that everyone thinks every itch worth scratching. I challenge someone to point to a single feature in PHP not implemented, possibly more cleanly, elsewhere.
    I submit that, the next time there is a burning itch to create a Purely Half-assed Project, the would-be developer should, instead, go study some existing work and focus on improving it, instead of prolonging the reign of the Mephistophelially Smug. F/OSS will benefit from this restraint.
    </troll>

  30. An excellent book. by veg_all · · Score: 3, Informative

    I ran across a used copy of this book in The Strand and have to say it has taken its place next to The Cookbook on the shelf of Truly Useful Books. All the "advanced" php books I had found before this one either had a three or four page spread on objects and classes or (in the case of one awful Wrox book) scads of code with little useful description of the considerations that went into its architecture. If you're coming to php from a non-coding background, you'll find that most books seem to stop just before the discussion gets truly interesting (and useful). No, I don't already know how to make use of inheritance, and telling me that it involves extending a class without describing why I would want to do that and how to design classes so it can be done intelligently and powerfully is pretty useless.

    This book deals with those advanced topics in substantial depth. Want to know what strategies should be considered in deciding how far to abstract database classes? Want an in depth discussion of preformance caching? Care to contemplate the values of various distributed architectures? Interested in Zend engine internals? From coding style clear through application benchmarking, this book covers it, and it covers it thoroughly and engagingly.

    --
    grammar-lesson free since 1999. (rescinded - 2005)
  31. php by grahagre · · Score: 0

    remeber everyone, grahamg.org is powered by php... kickass!

  32. Re:"Advanced" PHP "Programming"? by grahagre · · Score: 1, Funny

    uhhhh.... no php would be scripting not programming duh ;-P

  33. Re:php-embed--troll/rant by mangu · · Score: 1
    I challenge someone to point to a single feature in PHP not implemented, possibly more cleanly, elsewhere.


    OK, I'll byte. (1) Database access from a website. (2) Form manipulation. Name one other language or system where it's easier to dynamically create a set of html pages with data extracted from a database. Or a language where it's easier to get and use data from a form filled by the user.

  34. Re:Advanced PHP programming by Anonymous Coward · · Score: 0
  35. Re: Against Apache 2.x? by Anonymous Coward · · Score: 3, Informative

    you are a ridiculous karma-whoring troll... this is not information, this is what Rasmus has been saying for a while because not all php extensions are thread safe yet. And Rasmus isn't even opposed to apache 2, he's opposed to people encountering an error with those non-thread safe php extensions. After all, Rasmus IS a core apache http server developer as well.

  36. Re:Advanced PHP programming by imroy · · Score: 1
    • Compassionate conservative

    :)

  37. the problem with your problem by vena · · Score: 1

    as PHP has grown more complex, it has continued to support and enhance the same basic tools that made it easy to use in the first place. what PHP is doing is making more advanced tools *available*, they're not making them necessary for use of the language. i would compare the maturation more to, say, QuickBasic which added functionality above BASIC while continuing to support its basics rather than the rehaul of Visual Basic into VB.NET

    if i were to say PHP has had a change in scope, i would say that it is attempting to bridge basics to mid-level programming rather than leave the basics behind.

  38. SQL Server 2000 by oliverthered · · Score: 1

    SQL Server 2000, what year is this?

    On a more serious note,
    PHP==free
    Apache==free
    MySql=free
    Postgr esql=free

    IIS=!free
    Oracle=>!free
    SQL Server=!free

    I use Apache 2 because it scales better and Postgres because I already know sql and don't want to spend half my life screaming because MySql doesn't support xyz abc etc...
    Infact I try to avoid having MySql on anything, because I know that if i ever want to extract or archive my data it's going to be a pain.

    --
    thank God the internet isn't a human right.
    1. Re:SQL Server 2000 by Anonymous Coward · · Score: 0

      Haha, MS is stuck thinking the year 2000 is the future, just like Conan O'Brien.

  39. Re: Against Apache 2.x? by Anonymous Coward · · Score: 1, Informative
    PHP developers are not opposed to Apache 2.x.

    Certainly, noone is opposed to Apache 2.x. It is a very good idea to make PHP work flawlessly with Apache 2, and once some certain technical problems gets corrected everything will be nice.

    PHP is stable on Apache 1.3 _AND_ 2.x.

    PHP is not stable with Apache 2. Rasmus Lerdorf's explanation is widely known, and is part of PHP's FAQ now. Basically, many extensions that PHP rely upon don't work well in threaded environments, and it's quite tricky to know exactly which ones and how to fix them (either on the library level or the PHP level).

    Apache 2.x has a large number of new features designed to better handle high volume sites (with or without PHP)

    Apache 2 was built to handle high volume sites differently, which happens to provide a huge performance boost on Win32 systems.

    All in all, your message is kind of disappointing for someone who sounds like he knows what he's talking about.

  40. Re:Advanced PHP programming by globalar · · Score: 1

    Even the simplest tools can be used to great effect. Likewise, the most sophisticated ones can be applied ineptly. I take advanced to mean "what you always wanted to do".

  41. PHP x Java x .NET by Anonymous Coward · · Score: 1, Insightful

    I think the most difficult decision is which tool/language should you use.

    If you are a programmer it's always good to look around, see what this language can do, specially if better/faster than the current one.

    When you have a software house this can be tricky. I've been doing some development from small sites to small applications and every now and then comes a question: should I change to java (jsp) ?

    Seems that the EJB-something is a great thing but only pays if you have really big projects, otherwise you will end up having a complicated setup to do a simple thing.

  42. Re: Against Apache 2.x? by Anonymous Coward · · Score: 0

    You're a moron.

  43. Re: Against Apache 2.x? by Anonymous Coward · · Score: 0

    PHP is stable on Apache 2.x, using the Prefork MPM. Can't you read?

  44. Re:php-embed--troll/rant by Fweeky · · Score: 2, Interesting

    What features does PHP have which make it especially suited to form and database interfaces? Many languages have easy to use CGI/FCGI/Server API's; many have HTML-embedded versions and high quality template libraries; many have database libraries which easily rival and surpass those of PHP, and many have fancy dynamic form generation and processing libraries.

    PHP's far from best-of-class in any of these respects in my experience; only pervasiveness is in it's favour, and running my own servers, that isn't much of a conern to me.

    Give me an example of how easy it is to interface a form with a database, complete with validation and listing using PHP in ways other languages can't match. In fact, show *anything* which you can do more cleanly in PHP than any other language, and you'll be on your way to having a decent response to the grandparent poster.. and me ;)

  45. Re: Against Apache 2.x? by Fweeky · · Score: 1

    Are there any proper Object-Relational database libraries for PHP yet? PEAR:DB, ADODB etc are all well and good, but they do little more than wrap the various PHP *sql*() functions and abstract away some minor database differences with various levels of success; I've not seen anything which I can point to a database, give it some hints on relationships, and have it generate the majority of my database interface code for me.

  46. Re:"Advanced" PHP "Programming"? by sulaco252 · · Score: 0

    "Programming is the activity that involves a person writing instructions in a language closely related to the English language, in order to make a computer perform useful operations. These instructions collectively form a program, which is like a "recipe" for a computer, which it follows in order to perform useful operations. This program is then compiled by a compiler, into a form that the computer understands. This compiled program can then be run on a computer."

    It is not programming because...?

    --

    (There used to be something clever here.)

  47. Support the Author by shiflett · · Score: 1

    http://www.amazon.com/exec/obidos/ASIN/0672325616/ georgeschloss-20/

    That link gives George a bit more money. If you're feeling really generous, visit his blog and click the little "Buy from amazon.com" button. He gets a larger percentage from those (ironically, more than he'll get from royalties).

  48. Re:php-embed--troll/rant by moro_666 · · Score: 2, Insightful


    OK, I'll byte. (1) Database access from a website. (2) Form manipulation. Name one other language or system where it's easier to dynamically create a set of html pages with data extracted from a database. Or a language where it's easier to get and use data from a form filled by the user.


    Are you kidding ?

    1) Java's db api is much more cleaner and database independent, You don't have to rewrite your function calls to switch the database implementation (e.g. moving from mysql to postgres and from postgres to oracle, in java you will only have to switch the string which chooses the db driver, in php you will have to rewrite all the code implementation that has [dbname]_connect, [dbname]_query etc. calls.). the same goes for perl. and python. imho this is seriously f_cked up in php, using the word 'clean' here is absolutely n00bish. and how to you update a blob from php ? (thinking SELECT bar FROM boo FOR UPDATE) ? it's simple, you just can't.

    2) every proper MVC system has an implementation on DBForms which creates default forms from database structures without needing any kind of input in the code except the table name (input fields types & values are generated/validated/handled automatically). in php i have seen such features only in frameworks alike (php doesn't have any kind of dbforms implemented by default). so php doesn't really make anything "easier" here.

    the worst in php in my experience is that i have to worry about how to get & feed my dates'n'times to the database, in java it's very simple, i always have one type of timestamp, no questions asked. in php i always have to be very aware of my DB behind the datamining cause it doesn't give me the same type of variables while asking them from mysql/postgres/oracle/sybase, if i want to compare the query result from different database types, i'll have to convert the timestamps in my code to compare them. this is pretty much absurd. at least for a "high level language".

    so i can't really see how php is superior in any way.
    it's backward compability is mostly zero. the dudes over zend just think that hey, let's make now php5 and break the whole OOP stuff that we had until now. (we're probably going to rewrite our 'framework' over here, to make it work again. :( )

    besides until there's no threading and variable sharing possibility, it's still far behind perl & python.

    for a schoolboy, php might be cool. for a developer that has been working with code since 1990, it seems like an vegetable hamburger (sure it's edible at some times, but i prefer pizza,pasta or a proper meal with some meat in it.)

    --

    I'd tell you the chances of this story being a dupe, but you wouldn't like it.
  49. Re:php-embed--troll/rant by Pathwalker · · Score: 1

    Hmm - I'd have to say that using RXML's emit and tablify tags together is about the easiest way possible to quickly get data from a database into a decent looking form for an end user.

    And considering that accessing a form value or a cookie is as easy as &form.varname; or &cookie.cookiename;, hooking cookies and form variables into the page is about as easy as it can get.

  50. Re:php-embed--troll/rant by Anonymous Coward · · Score: 0

    Are you actually that stupid, or is this a counter-troll?

  51. Good book by Doyle · · Score: 2, Informative

    I bought this book a couple of weeks ago. It's very good. I like the way it covers the general topic of "how to write applications well" as opposed to focusing purely on writing in PHP.

    My only criticisms of the book are: (1) It would be nice to see more OO patterns stuff in there (particularly database access patterns), (2) There are a couple of mistakes in the code that got me puzzled for a while. On the whole though, an excellent read.

    1. Re:Good book by webmosher · · Score: 1

      Hrmm...

      If you need patterns, you may as well look at a generic patterns resource like Addison Wesley's excellent book on Application Patterns (ISBN 0321127420). While it has a strong J2EE bent, if you can't adapt a generic idea like a pattern to another language, then you need alot more help than these books provide. It also goes into intricate detail on DB type patterns, levels of abstration and when to choose the appropriate pattern.

      With PHP5, object oriented programming becomes more Java-like, so adapting pattern examples should be straightforward. I've already found that creating code based on complex pattern interactions is much easier to manage with PHP5 than in 4. I really wish the PHP docs out in the wild had better information on Relection. I might look at this book to see what it might offer.

  52. Why don't the PHP people fix their license? by hopethishelps · · Score: 1
    Another thing to note is that MySQL has placed their libraries under the GPL, making them somewhat incompatible with the PHP license.

    Seems to me that's a problem with PHP, not a problem with MySQL.

  53. strongly typed language features by smallguy78 · · Score: 0

    ..for a loosely typed language. All of these features seem fairly useless without it having the speed of being compiled (there's compilers out there, but no built in one), especially as most php programmers use it for a quick and easy language. And those that don't end up with reams of spaghetti, even OO php. One plus is the access modifiers though

    --
    Nothing costs nothing
  54. Re:"Advanced" PHP "Programming"? by grahagre · · Score: 0

    uh... i think i know what programming is and the definiation of it thank you very much; smartass.

  55. Advanced PHP Programming? by Anonymous Coward · · Score: 0
  56. Re:"Advanced" PHP "Programming"? by grahagre · · Score: 0

    since were having fun with definiations now.....

    Scripting languages are lightweight, easy-to-learn programming langauges which let you glue stuff together in novel and innovating ways without getting bogged down in the Turing Tarpit. Good examples are Perl, Tcl, Python and UserTalk.

    (everything2)

  57. Re: Against Apache 2.x? by Anonymous Coward · · Score: 0

    and you're a homo

  58. Abstraction Layers by brewpoo · · Score: 1

    I agree that some applications are better off with Postgres but a half way decent abstraction layer and portable queries go a long way. I've changed some of my concurrent update intensive applications to a postgres back-end very easily.

    1. Re:Abstraction Layers by Anonymous Coward · · Score: 0

      > a half way decent abstraction layer and portable queries go a long way.

      Such as? Mysql deviates from standards sooo much, it's not possible to easily port it to other db's.

  59. PHP5 is uneeded by Diclophis · · Score: 1

    Here is what is PHP4's OO model is capable of:

    SiG

  60. Ewww! by Anonymous Coward · · Score: 0

    Just because it's a scripting language doesn't relieve one from commenting the code. Commenting out debugging/bogus code doesn't count, either.

    This crap looks a lot like what a co-worker of mine produces. Why is commenting such a hard concept for so many people?

    1. Re:Ewww! by Diclophis · · Score: 1

      DOCS documentation is 'outside' of code. I feel you should be able to read the code and know whats going on (within the confines of a 'API')

    2. Re:Ewww! by Anonymous Coward · · Score: 0

      Is this supposed to be the "external docs"?

      private void html_data( integer $depth )

      Warning: documentation is missing.

      Parameter
      integer
      $depth

      Warning: documentation is missing.

      Returns
      void

      Sorry, external docs don't replace good commenting. API documentation tells you what it does, not how. The latter isn't important if you're writing external code against it, but it's the entire fucking point when you're working on the code itself.

  61. PHP and unicode by UnConeD · · Score: 1

    Now if only the PHP devs hadn't totally ignored Unicode support for PHP5, we might have had the perfect weblanguage.
    Now you're still limited to ugly hacks and extensions that the typical PHP installation does not have, and the Americans/Brits are still unaware that there's anything beyond ASCII.

  62. Re: Against Apache 2.x? by Anonymous Coward · · Score: 0

    I know you are.

  63. Re:"Advanced" PHP "Programming"? by sulaco252 · · Score: 0

    PHP may be a "scripting" language, however the act of using it IS programming. Why do you have to go to a lower level by calling me a smartass? It's really not that big of a deal.

    --

    (There used to be something clever here.)

  64. Re:"Advanced" PHP "Programming"? by grahagre · · Score: 0

    oops, im used to flamewars over this kind of thing; sorry ;-P

  65. Advanced PHP Programming? by Anonymous Coward · · Score: 0

    Isn't that an oxomoron? Seriously, PHP and MySQL??? What's wrong with Perl and Postgres?!