Slashdot Mirror


PHP 5 Power Programming

norburym writes "PHP 5 Power Programming is the latest in the Bruce Perens Open Source series of technical books focusing on Linux and Open Source technologies. Prentice Hall PTR publishes each book under an Open Source book license and provides free electronic versions several months after each book's publication. This particular book also includes a link to a 90-day version of Zend Studio, an IDE for PHP which also includes a PHP debugger, code analyzer and code profiler. PHP 5 Power Programming was written by Andy Gutmans (co-creator of PHP versions 3 through 5), Stig Bakken (creator of PEAR -- the PHP Extension and Application Repository -- a framework and distribution system for reusable PHP components) and Derick Rethans (leader of the PHP QA team). The move to PHP 5 has begun and this volume will prepare power users with the necessary knowledge and tools to make the transition from v.4 easy. Gutman et al. provide PHP engineers and experienced web programmers a proficient introduction to the enhancements and improvements in PHP 5." Read on for the rest of Norbury-Glaser's review. PHP 5 Power Programming author Andi Gutmans, Stig Saether Bakken, Derick Rethans pages 720 pages publisher Prentice Hall/PTR rating 9 reviewer Mary Norbury-Glaser ISBN 013147149X summary PHP 5 Power Programming

Chapter 1 sets the stage by asking "What Is New in PHP 5"? The chapter begins with a quote from John Scully: "The best way to be ready for the future is to invent it," which perfectly describes the authors: Andy Gutmans and Zeev Suraski have continued to push the PHP project to improve on the original foundation and to add cleaner programming enhancements. The leap from v.4 to v.5 is no exception, as this new version has brought singular advances: OO programming with PHP enjoys a leap forward in focus with a complete redesign of its object model, a completely re-written MySQL extension (MySQLi), support for SQLite, a new mechanism for handling errors via exceptions, a suite of re-written XML extensions based on the libxml2 library, a C-based implementation of SOAP and a new memory manager.

Following this tour of the new features of PHP 5, the reader is exposed to a brief chapter on the basic language of PHP. An experienced developer can skip this chapter, but it's a very good overview of the syntax including variables and superglobals, basic data types (integers, strings, booleans, arrays, constants), operators, control structures (conditional, loop, code) and functions.

PHP 5's OO support is the subject of Chapter 3. Object oriented programming was introduced in PHP 3 but it was in an extremely elementary form and while it was improved upon in PHP 4, it truly comes into its own in PHP 5. Covered in this chapter are the basics of the OO model, object creation and lifetime, access restriction keywords and the benefits of using class inheritance, as well as tips for exception handling.

Chapter 4 is a well written chapter on advanced OOP and design patterns (strategy, singleton, factory and observer), with some very good code examples on iterators and the reflection API, which allows the programmer to collect information about his or her script at runtime.

Chapter 5, "How to Write a Web Application with PHP," is an excellent fusion of code and best practices in developing a complete dynamic web application based on PHP. The concept of good design practices is often overlooked in "how-to" manuals. Rather, many technical books focus on overcoming code issues and avoiding pitfalls associated with poor code execution. Here, the authors take time out to detail techniques on making scripts "safe" ("trust nobody, especially not the users of your web applications"). Bugs and security holes are a fact of life, and this chapter covers some very practical techniques to avoid consequences arising from weirdness caused by users as well as from deliberate attempts by bad guys to crack a site's security.

Databases are covered in depth in Chapter 6. SQL and SQLite are discussed (each with a section on strengths and weaknesses) before examining the new database-connectivity features of PHP5 using mysqli and sqlite extensions. PEAR DB is also presented, with a section on the pros and cons of using a database abstraction layer like PEAR DB. Connections, queries, fetching modes/results and other topics are well covered. I would have liked to see some additional discussion and implementation of SMARTY in this chapter. SMARTY is a template engine with an ability to cache templates into PHP scripts which saves on overhead and contributes to speed and efficiency.

Error handling is the topic of Chapter 7. Types of errors (undefined symbol errors, portability errors, runtime errors and PHP errors), PEAR errors (PEAR_error class, handling of PEAR errors and PEAR error modes) and exceptions (exceptions explained and the specifics of using exceptions) are treated adroitly.

"XML with PHP 5" in Chapter 8 will undoubtedly become a focal point of the book for many readers. Along with the addition of support for OO programming, using the new XML extensions are some of the most exciting developments in PHP 5. The XML implementation is standardized on libxml2, compliant with W3 standards and extremely efficient. This chapter introduces XML in PHP 5 with sections on the vocabulary of XML, parsing (SAX, DOM, XPath), the SimpleXML extension (very cool, because this allows the programmer to access the XML through a data structure representation, treating the information as objects), PEAR classes that deal with XML (XML_Tree, XML_RSS), converting XML and communicating with XML (XML-RPC, SOAP). PHP 5's new SOAP extension is a welcome improvement over previous PHP versions.

Following this excellent chapter is one on other valuable mainstream extensions: files and streams (I/O streams, compression streams, URL streams, locking, renaming and removing files, temporary files), regular expressions, date handling, graphics manipulation with GD ("gif draw" to old-timers, "graphics draw" to the youngsters) and multi-byte strings and character sets. This is a solid chapter encompassing the wide range of functions that are intrinsic to the core of PHP to the many favorite and practical extensions that are outside the core of PHP.

Chapters 10 through 12 deal with PEAR: installing PEAR, commands, packages and components. Stig Bakken's extensive knowledge and experience is obviously prevalent here. It's worth noting that you won't find a better single coverage of PEAR and PHP 5 anywhere else.

For those readers experienced in PHP 4 and who are looking to move to v.5 and are wondering what to expect during the transition, Chapter 13, "Making the Move", will be of particular interest. The authors suggest that in migrating to PHP 5, "you can encounter some minor incompatibilities" and address a number of these: using compatibility mode to revert to PHP 4 behavior, recognizing script problems using OO features and learning the new names and locations of files in the PHP 5 distro, among others. Users of PHP on the Windows platform may want to spend some time over this chapter (and maybe reconsider their choice of development platform!).

Designing for performance is the subject of Chapter 14, and the authors encourage the reader to plan for optimal performance during the design phase: benchmarking, profiling with Zend Studio's Profiler, APD (Advanced PHP Debugger) and Xdebug, using APC (Advanced PHP Cache) and ZPS (Zend Performance Suite), optimizing code using micro-benchmarks, rewriting in C and writing procedural versus OO code. This extensive chapter offers the reader a fairly complete set of tools and sage advice for more efficient design.

Chapter 15 is titled "An Introduction to Writing PHP Extensions," and introduces the extension API that allows developers to write custom PHP extensions. This isn't a chapter for everyone, since there are already a large number of available extensions and, as the authors note, unless you need to wrap an existing C library to give it an interface from PHP then you can easily skim or skip this chapter entirely. Note, though, that memory management has a section here and it's worth a read because of PHP 5's support for multi-threaded environments.

The final chapter of the book is called "PHP Shell Scripting," and explores the CLI SAPI (command line interface Server API). There is an introduction to PHP CLI shell scripts (how CLI differs from CGI, the shell scripting environment, parsing CL options, good practice) with some nice examples.

Appendices on PEAR and PECL (PHP Extension Community Library) Package Index, phpDocumenter format Reference and Zend Studio Quick Start Guide complete the volume.

The authors succeed in providing an excellent manual for "power programming" in PHP 5. There is terrific guidance here for many PHP developers and experienced Java, C++ and C# coders who are looking to either migrate to PHP 5 from v.4 or who are looking to gain experience in PHP programming. The experience the authors bring to the table is indisputable and their style of writing and the ease with which they bring new language and tools to their audience is admirable.

You can purchase PHP 5 Power Programming from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

218 comments

  1. Upgrade to 5 by Anonymous Coward · · Score: 1, Interesting

    Out of curiousity how many people are using PHP5? My hosting still only supports 4.3.something. And I'm still doing my testing strictly on 4.x to match current hosting options.

    1. Re:Upgrade to 5 by The+Snowman · · Score: 4, Informative

      Out of curiousity how many people are using PHP5? My hosting still only supports 4.3.something. And I'm still doing my testing strictly on 4.x to match current hosting options.

      I tried using PHP 5 with my web host. It was a little bit slower, probably because version 5 was compiled as a CGI instead of a module. I am sure a comparison of both as modules would have been pretty close, if not dead even. Anyway, everything worked fine. From what I can tell version 5 is good for backwards compatibility.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    2. Re:Upgrade to 5 by canofbutter · · Score: 4, Interesting

      We were in the process of upgrading to 5 until we basically saw no good reason to. The annoyances we found with 4 are still present in 5 and the OOP additions seem completely irrelevant or steps backwards; constantly requiring $this->... inside methods and the use of "__construct" didn't seem like the right direction to move in; as a result 4 will be our standard until we have no choice.

    3. Re:Upgrade to 5 by kyrre · · Score: 2, Informative

      Debian still has no PHP 5 support, that probably helps. I am not sure why. Anyway, will hold out until PHP 5 goes .deb. The only thing I install from source on my servers is the Linux-kernel.

    4. Re:Upgrade to 5 by onlyjoking · · Score: 3, Funny

      Isn't that what Debian is all about - waiting ..... and waiting ..... and waiting?

    5. Re:Upgrade to 5 by Technel · · Score: 2, Informative

      At the moment, not many shared web hosts support PHP5. I know that recently I bought "PHP5 and MySQL Bible" and learned about the many of the new features, but I was dissapointed to find out that a lot of the hosts out there right now do not support the new version.

      For now, you will either have to scavenge the internet to find a host that supports it, or wait until it becomes more mainstream.

      Another reason I believe that many hosts are not making the switch is that many popular PHP software has not been upgraded to support PHP5. phpBB, InvisionBoard, and the like all support PHP4, but have mainly 3rd party versions for PHP5. Why make the switch when most do not support the updated version?

      (By the way, first post!)

    6. Re:Upgrade to 5 by greenskyx · · Score: 1

      My host telana.com runs PHP5. It actually has a really nice setup running php as your user rather than 'www' or 'nobody' and it doesn't run in cgi or safemode either.

    7. Re:Upgrade to 5 by j.someone · · Score: 3, Informative
      I've been using PHP5 since the betas and code my scripts exclusively for PHP5.

      After speaking with many hosts, they won't upgrade because their hosting package (ie: cpanel) doesn't support it yet. And they won't upgrade until that happens. The problem with cpanal supporting it is that some of the scripts they bundle (namely osCommerence) don't work in PHP5.

      I've also found a lot that people still believe PHP5 is in beta and not compatible with PHP4 code. But here's the good word on the situation from the PHP folks.

    8. Re:Upgrade to 5 by Drako2 · · Score: 0

      The OOP in PHP5 is "better", but really implemented in the same sort of way a lot of things in PHP are; very loosely. One such example is that a class that implements an interface is not required to implements all of the interface's prototypes.
      XML support is pretty good with SimpleXML, and is one of the main reason we've upgraded most of our servers. We also found it very transparent switching from PHP4 to PHP5, excluding that you cannot use "this" unless you are in an Object, which was not the same in PHP4;

    9. Re:Upgrade to 5 by Nehle · · Score: 1

      My hosting company (PowWeb) has PHP4 and 5 running side by side, and lots and lots of handy extension, I program exclusively for PHP5

    10. Re:Upgrade to 5 by digidave · · Score: 1

      I run my own servers, but still only have PHP 4 so I can support our legacy application. I will be re-writing the app in PHP 5 later this year since the old app is in need of a major upgrade anyway. I've already done a lot of PHP 5 testing on my dev box.

      --
      The global economy is a great thing until you feel it locally.
    11. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      hosteurope.de (which for example hosts the larget online photo community in the German-speaking area) uses php5 by default.

    12. Re:Upgrade to 5 by nocomment · · Score: 2, Funny

      no. That's Gentoo. Oh and Windows.

      --
      /* oops I accidentally made a comment, sorry */
      /* http://allyourbasearebelongto.us */
    13. Re:Upgrade to 5 by DarkHelmet · · Score: 3, Informative
      The small hosting company I own, Warp99.com runs it. I offer copies of apache running per user, incremental backups, blah blah (I shouldn't start hawking it until I get the site redesigned)...

      I do a lot of DOM / XSLT programming for freelance and for my job. I just refuse to use PHP4 when I don't have to do so. DomXML in PHP4 used functions in order to return objects.

      E.g: $node->first_child();
      Therefore, it was impossible to go:

      E.g: $node->first_child()->attributes;
      In PHP5, it's simply:

      $node->firstChild->attributes;
      I believe in PHP5, it's possible to call the method of an object returned directly ($obj->func()->func2()).

      The upgrade from PHP4 to PHP5 is nowhere as painful as from PHP3 to PHP4. In fact, the only errors I ended up logging when I transitioned over were my own coding errors that didn't show up in PHP4 ($this->item was being referenced outside of a class).

      I'm gonna be loading the MySQLi module on there when I get the chance. I've really been itching to do stuff like MySQLi::prepare outside of Pear:DB. Not to mention, being able to use SSL to connect to MySQL from PHP is a definate plus.

      --
      /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
    14. Re:Upgrade to 5 by mattyrobinson69 · · Score: 1

      in gentoo you can start the install yesterday, finish the install after the 32bit unix time rolls over to january 1st 1970.

      in debian you can start the install after the 32bit unix time rolls over to january 1st 1970, and finish the install the same minute.

    15. Re:Upgrade to 5 by Martin+Blank · · Score: 1

      I thought I read somewhere that Invision supported use on PHP5?

      And phpBB 3.0 (whenever it comes out) is supposed to work cleanly on PHP5.

      --
      You can never go home again... but I guess you can shop there.
    16. Re:Upgrade to 5 by Anonymous Coward · · Score: 0
      One such example is that a class that implements an interface is not required to implements all of the interface's prototypes.


      Perhaps you can explain what you mean by this? It seemed at odds with my observations so I wrote a test case:
      <?php
      interface Test { function foo($a); function bar($b); }
      class Baz implements Test { function foo($a) { return 0; } }
      ?>
      And got the error: "Fatal error: Class Baz contains 1 abstract methods and must therefore be declared abstract (Test::bar) in - on line 3"
    17. Re:Upgrade to 5 by TheTomcat · · Score: 1

      I've been running 5.0 on my (mostly amateur) production box since last July (shortly after it was launched).

      My main upgrade problems:
      - the aforementioned $this issue
      - array_merge now requires that all parameters be arrays

      The second seems like it wouldn't be a problem, but I was running various third party software that passed string to array_merge. Simple workarounds, and now PHP 5 (and even PDO) in all its glory.

      S

    18. Re:Upgrade to 5 by Technel · · Score: 1

      I did some more research, and it appears now that IPB 2 does support PHP 5, but 1.x does not. I am looking forward to phpBB 3, looks like it is going to turn out really nicely.

      Another thing mentioned was cPanel. cPanel in its current version does not work with PHP5, although I believe it is in production.

      This is all part of the transition.

    19. Re:Upgrade to 5 by DarkHelmet · · Score: 1
      The one thing that still bugs me about PHP5 is that classes that are instanced in a global scope don't echo anything on destruction.

      http://bugs.php.net/bug.php?id=29372

      I reported a bug, but they still didn't fix this for 5.0.3... Of course this doesn't happen in PHP4 since destructors don't exist. Eh.

      --
      /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
    20. Re:Upgrade to 5 by Saeed+al-Sahaf · · Score: 1

      There is not much problem running both PHP4x and PHP5 on the same server. My host did it with v.3 to v.4 and is doing it with v.4 and v.5. Just a matter of the document extension...

      --
      "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    21. Re:Upgrade to 5 by jaydonnell · · Score: 1

      I've been using php5 for a while now. I started developing a blogging site and decided to use php5 because I had no compelling reason not to. So far so good. The only down side is that I really miss having exceptions when I'm coding php4 at work :(

    22. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      There are a lot of things about your web site you should fix before you start whoring it. The list of non-professional and non-functional elements is longer than my tape worm.

    23. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      Not to mention not running it off a DSL line! LOL!

    24. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      YOU are tEH funny! OMG LOLOLOLO!!!!211!!

    25. Re:Upgrade to 5 by DarkHelmet · · Score: 1
      So tell me anonymous coward. Will you be paying with cash?

      Oh, I'm sorry. We only take credit cards. I know you don't want to give us your name and all, but I don't feel like getting a Fecalgram in the mail, and I certainly don't feel like meeting you by the docks.

      Especially with that tapeworm and all.

      Heheh, have a good one.

      --
      /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
    26. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      Moderators, why is this moderated up?

      constantly requiring $this->...

      All object-oriented programs have a method to have a class call itself. Python uses self, why can't PHP use $this->?

      "__construct" didn't seem like the right direction to move in

      You mean having a class initiate at the start without having to call upon it? Oh no! That's definately a step in the wrong direction.

      PHP4 OO was not what a true OO model was about and it appears that the poster is stuck in this train of thought. PHP5's OO is how it should have been implemented from the start.

    27. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      I'm coding exclusively for PHP5 now, the built in SQLite support is awesome for small to medium size database requirements and the OOP support is WAY better now. Only PHP4 I code now is in support of a number of osCommerce installations I manage. PHP5 is here to stay and well worth the update!

      (I can foresee quite a few problems in the coming months with all these large established PHP4 apps making the move to PHP5 i.e. osCommerce, cPanel etc)

    28. Re:Upgrade to 5 by OzRoy · · Score: 1

      All of my projects use PHP5.

      All the systems on my current project (http://www.gamespace.net.au/), except the forums, where developed with PHP5 in mind, and while their development started with PHP4 as soon as 5 was stable they were cut over and a lot of the new features were implimented. The greatest feature in PHP5 apart from the much improved OO has to be __autoload.

      If an attempt is made to access a class that the interpreter doesn't know about it will call a special function __autoload which can be used to include the appropriate file. So you can split all of your classes into seperate files and they will only be included and compiled when you need them. It improved the performance of my systems by at least half.

    29. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      Actually, I'd say it's a very professional site. I work at a mid-sized ISP, and I much perfer his page to our own. It's nice and clean without a ton of extra BS

    30. Re:Upgrade to 5 by canofbutter · · Score: 2, Interesting
      All object-oriented programs have a method to have a class call itself. Python uses self, why can't PHP use $this->?

      Obviously all OO has a "this" (or similar) for self-referencing, however PHP5 *requires* its use for referencing class variables; it seems silly to always have to be explicit when standard scoping rules would apply.

      You mean having a class initiate at the start without having to call upon it? Oh no! That's definately a step in the wrong direction.

      It's obvious that a constructor is required for a class, I'm pointing out that it's silly to use __construct for the method name rather than the name of the class (as is convention in just about every other OO language and was what PHP4 used)

    31. Re:Upgrade to 5 by Martin+Blank · · Score: 1

      Cpanel has PHP5 marked as experimental in the compile area, so they must be playing with it. As the apps out there begin their major move, Cpanel will be dragged into the future.

      Maybe one day, they'll even ditch Exim.

      --
      You can never go home again... but I guess you can shop there.
    32. Re:Upgrade to 5 by SlightOverdose · · Score: 2, Insightful

      The reason __construct was used is so you can call the parent constructor without having to know it's name. This makes it easier when refactoring code.

    33. Re:Upgrade to 5 by canofbutter · · Score: 1

      I guess I liked Java's approach to that better: super() and super.thing. parent::__construct seems to cause that to follow a less object oriented model and lead more to still thinking to imperatively; not that PHP4 was any better, but if they were making improvements anyway, why not do something like parent(...) for the parent constructor?

    34. Re:Upgrade to 5 by rbbs · · Score: 1

      We've coded an entire medical practice management suite in php5 with pgsql. the whole is is completely oo'd and could not be back ported to php4.
      Why do this? mainly because we now have a complete classes based development environment which is used to enable us to add new features extremely quickly. when that is combined with nice pgsql features like triggers which allow us to store a lot of our queries in the database and makes the code so much cleaner (ie when new appointment row created, add this to event log, and that to charge), we have a truly amazing development environment.
      the next stage for us is to incorporate the ajax cool stuff and really make our baby fly...

      the best thing about all of this is that our clients are amazed at how quickly we can churn out custom mods - page layouts are just css, add a new reporting tool is just another row in the database...

      stable, secure, platform independent...it is truly the way of the future...

    35. Re:Upgrade to 5 by Steward5732 · · Score: 1

      I am not using PHP yet. It still take longer number of code lines compare to .NET and C#

      --
      Free Posting on thousands and hundreds cities in World Cities Community
    36. Re:Upgrade to 5 by WebHostingGuy · · Score: 1

      Don't count on it anytime soon though. cPanel marks a lot of things beta, working on it, almost finished etc. For example, they have been working on a Windows cPanel 87% finished for *years* now.

      I would say it will be at least six months before they release a compatible version and then at least a few months more before the bugs are worked out. However, when you do see cPanel fully supporting the installation and features of PHP 5 you will then see the slew of web hosts begin to offer it.

      We have had a few requests for this new version but have not installed it on any production servers simply because there are existing clients who would be destroyed by the sudden change they would have to make in their scripts and programs. There are a lot of people who do not need the latest and greatest one function but are too busy managing the true reason for a web site (make money, forward a concept, do business, etc.) to be changing something that already works. Between taking care of business and taking care of potential security concerns the typical website owner does not need (nor want) to redo a site with the latest [fill in the blank].

      --
      Quality Hosting e3 Servers
    37. Re:Upgrade to 5 by rycamor · · Score: 1

      I'm pointing out that it's silly to use __construct for the method name rather than the name of the class

      AFAIK, PHP 5 lets you use either the classname or __construct as the constructor. Each approach has its pros and cons; it's nice to be free to make the choice.

    38. Re:Upgrade to 5 by dreadlock9 · · Score: 1

      Both the hosting companies I use have PHP 4.3. I do all my development on PHP 5, but I keep most of my code 4.3 compatible. This works out pretty well for me. PHP 5 passes objects to functions by reference, so if you want to stay compatible with PHP 4, you still have to use $ref &= $someObject.

      It seems like hosting companies are slowing the adaptation of PHP 5, because a lot of old scripts will not run with PHP 5. I would like to see more hosts offering a choice of 4 or 5.

    39. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      in debian you can start the install after the 32bit unix time rolls over to january 1st 1970, and finish the install the same minute.

      No, in Debian you install once in 1997 and run the same system in 2005. Just changed the box two times and transferred over from one hard disk to another about five times. All the rest is just upgrading! =)

    40. Re:Upgrade to 5 by 21chrisp · · Score: 1

      We're planning on moving to 5 in the near future, and I have been doing my development with it for a couple of months (obviously just using the php 4 syntax). I have noticed very few problems with our existing code. A few programs spit out error messages where there were none before, but they were actual coding problems. So far I would say 5 is nice and I'm looking forward to the more strict OOP features. PHP isn't the most well designed langauge out there, but it's better than most and 5 is a step in the right direction I think.

    41. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      yerp. PHP CGI is approximately 30 times slower. It won't seem this much slower til the server is getting hammered.

      PHP CGI spawns an entirely new php executible process for every request.

      Php running as a dso or hard wired into apache gets proc'd up with each web server child, and does not need to be created and destroyed on every request.

    42. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      stick to running servers man...

    43. Re:Upgrade to 5 by Anonymous Coward · · Score: 0

      Thank you, Captain Obvious.

    44. Re:Upgrade to 5 by tagattack · · Score: 1

      Oh great, so you mean PHP5 finally borrowed the method resolution behavior of Perl 5?

      Fancy that!

      There are a number of other languages which allow you to dereference return values and call member functions on them. One of them is (surprise surprise) ECMA, Also known as Java Script. Another one I fancy is Pike.

      PHP5 Still hosts a large number of the PHP4 Flaws. And additionally, bench marks show that it is still very damn slow. Not to mention the scope behavior of PHP5 is hardly more advanced than that of awk. C'mon now.

    45. Re:Upgrade to 5 by aztracker1 · · Score: 1

      Not to mention, being able to use SSL to connect to MySQL from PHP is a definate plus

      Umn, if the database server, and webserver have a private connection to eachother (as they should), not going over the internet(as they should)... isn't ssl to the database undue processor overhead?

      --
      Michael J. Ryan - tracker1.info
    46. Re:Upgrade to 5 by DarkHelmet · · Score: 1
      My production machines do have dedicated private connection between each other. Having a second NIC card on each machine definately has advantages.

      I know, I know, the database shouldn't even be visible on the public network, etc...

      But I'm looking into some PHP-GTK administration tools where I am, so I figure I'll poke a hole in the firewall to allow access to 3306 from my IP address, then have a secure socket connection between myself and the database.

      So ultimately, SSL does come in handy in some cases. After all, I doubt MySQL would have implemented it if there weren't any applications for it.

      --
      /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
    47. Re:Upgrade to 5 by ahdeoz · · Score: 1

      especially when php already has the builtin reflection capability to find the parent's class name

      you could easily create super like this:

      function super()
      {
      eval("parent->" . get_parent_class() . "()");
      }

      I'm sure there is some subtle gotcha (besides having to handle arguments), no reason not to include something like that instead of the __construct() method.

    48. Re:Upgrade to 5 by ahdeoz · · Score: 1

      I can't believe there aren't a lot of hosting companies out there willing to be a little more bleeding edge and charge a premium for newer features like PHP5. Is customer support really that big of a hassle. Oh, nevermind. I just remembered why every couple months I see an auction for a bunch of 1U servers and think "I could get into hosting..." only to realize that I don't WANT to get into hosting, even if I could make money at it.

    49. Re:Upgrade to 5 by aztracker1 · · Score: 1

      no doubting that there are indeed uses, just pointing out that someone putting in ssl for a local connection is adding a lot of overhead for no real value in doing so.

      --
      Michael J. Ryan - tracker1.info
  2. On Windows? by aspx · · Score: 1, Interesting

    Does he explain how to make the PHP interpreter work on Windows? Mine PHP 5 interpreter installed using the recommended procedure craps out at a paltry 250-300 visitors. My grandmother has more visitors than that.

    1. Re:On Windows? by oudzeeman · · Score: 1, Flamebait

      what is she, a prostitute?

    2. Re:On Windows? by jon3k · · Score: 1

      Well there are a lot of what-if's. You are running this on a windows platform. Might consider switching to Apache on Linux.

      What webserver by the way? Also - what are the specs on the hardware?

      It could be either:
      1. Your webserver
      2. Your hardware
      3. (no offense) poor programming
      4. Network problems
      5. A combination of some or all of the above

    3. Re:On Windows? by Ninjy · · Score: 1

      I believe PHP5 doesn't work well with Apache 2's ... er.. threading model, it was? I'm not entirely sure anymore, but it was something about the way Apache 2 handled different processes. I suppose looking into it wouldn't mean any harm.

    4. Re:On Windows? by tricops · · Score: 1

      Actually, this has been covered multiple times before in various locations, including at least a /. story and dupe or two. Basically, PHP 5 itself is multithreaded safe, but they basically refuse to recommend/okay Apache 2 for production use in their FAQ because so many extensions are still not multithreaded safe.

      Of course, Apache 2 does have the option to turn off multithreading which alleviates a large part of the issue, but also draws away from part of the reasoning behind switching to Apache 2 in the first place...

      --
      (\(\
      (^v^)
      (")")
      This is the cute vorpal bunny virus, copy to your sig or runaway, runaway in fear!
    5. Re:On Windows? by Anonymous Coward · · Score: 0

      Or it could be a buggy PHP interpreter. Zend sells a product called "WinEnabler" on their website for $495 that makes "PHP run stably on Windows." So clearly they are aware of the problem, and worse they know how to fix it but don't in the free version. Zend hooks you with a free product, gets you to write code using it, then sells you the solution when your site crashes shortly after going live. How's that for bait and switch?

      Sorry, I'm just a little short after spending the last two weeks baby-sitting my server. It's the last time I use PHP for any site with more than a couple of visitors.

    6. Re:On Windows? by digidave · · Score: 1

      Perhaps you're running on a Pro version of IIS, rather than a server version, that restricts the number of connections. Or if you're using Apache you'll probably have to increase the value of a few directives in httpd.conf to support that many concurrent users. The directives you need to change depend on which mpm you are using (prefork, threads, etc).

      --
      The global economy is a great thing until you feel it locally.
    7. Re:On Windows? by temojen · · Score: 1

      Worker-MPM and PerChild-MPM are off by default in Apache2. You have to go out of your way to use anything but Prefork-MPM (single threaded).

    8. Re:On Windows? by northcat · · Score: 1

      Grandparent is not flamebait. Parent is.

    9. Re:On Windows? by Anonymous Coward · · Score: 0

      That's for Unix. The Apache 2 default MPMs vary from platform to platform. The mpm_winnt default for Windows (which you'll note the original poster is using) is multithreaded.

    10. Re:On Windows? by Anonymous Coward · · Score: 0

      The number of concurrent connections allowed under a Workstation/Pro version of an NT product is a limit on the number of authenticated NetBIOS sessions, not socket connections.

      My department runs Apache 1.3.x under Windows 2000 Pro, and we regularly serve many more connections than ten. However, there is a limit if you use mod_ntlm or a similar product, just as there is a limit under IIS with NTLM or other NT security-based authentication schemes. With judicious curtailment of what is protected with NTLM (don't use those precious connections for images, for instance, just content), then you can happily live within those limits, even for a fairly large group.

    11. Re:On Windows? by sean23007 · · Score: 0, Troll

      Much better to skip PHP and use Microsoft products instead. That way, you pay the $495 for the base product and don't have any options at all for fixing their myriad problems.

      Why, exactly, don't you drop Windows and, thus, your problem?

      Nota bene: I don't use PHP, I find it too clunky, and instead use a Python framework I rolled myself. Still, I think your complaints are unfounded.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    12. Re:On Windows? by Anonymous Coward · · Score: 0

      This isn't PHP's fault. It's because most php sites sit over a MySQL database, with whole thing configured by someone who's installed linux two times in their whole lives.

      I've build a dual P-III 750 with 1 gig ram running PHP/Apache1.3/Linux/PostgreSQL that could handle 500 or more machine simos with no problem. Same basic app with java died at around 60 or so simo users.

      Java has serious issues with behaving poorly under load and crashing mysteriously at midnight for no apparent reason.

      I heard Rasmus Lerforf speak once, and his take on ava was: IT's a great language. I just wish it worked.

    13. Re:On Windows? by Anonymous Coward · · Score: 0

      oh, and by the way, source forge is written entirely in PHP.

    14. Re:On Windows? by Anonymous Coward · · Score: 0

      PHP on windows should only be used for development.

      Use BSD, linux, sun or unix for production environments (in order of sanity and common sense).

      Don't ask me to explain why, just try it. Make sure you install it into apache as DSO or compiled right into web server, your choice.

      The text of your post indicates you don't know enough about CGI vs. DSO(ISAPI on winders) to understand why, so just take my word for it.

      CGI=very very slow
      DSO=very very fast

      Make this your mantra. Just accept it as fact.

    15. Re:On Windows? by aztracker1 · · Score: 1

      Simply because *some* of us develop, and prefer ASP.Net, or have other apps which require a windows based server... IIS is a pretty decent server, putting aside bugs from 5 years ago, that were from modules a bit older than that.

      I like being able to put up a php utility site, as requested (phpbb/phpnuke etc).. php4(current) runs okay under isapi, and is more scalable, but less stable than the cgi version... this is a simple fact... more effort should be put into the ISAPI, as well as ASAPI (for apache2)...

      You response is pretty short sited.

      --
      Michael J. Ryan - tracker1.info
  3. still on 4 too. by acomj · · Score: 2, Insightful

    But 5 will come eventually. In the "Me TOO" world of web hosts, once one goes over , they'll all have to.

    That or they'll just when cpanel/plesk or what ever the contol panel of the day supports it..

  4. Hmm by GigsVT · · Score: 0, Flamebait

    Wonder why they took a perfectly good language and decided to crud it up with OOP.

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
    1. Re:Hmm by Anonymous Coward · · Score: 0

      OOP is the future of programming. It is a way programmers can separate themselves even further from their machines. It doesn't matter to them that the whole thing is turned into gotos, it takes longer to compile (or in the case of PHP interpret), and longer to run....

    2. Re:Hmm by Anonymous Coward · · Score: 0

      I think what you meant is why did they take a horrible language and make it even more horrible by adding OOP. Maybe they should've added modules first.

    3. Re:Hmm by Oxy+the+moron · · Score: 1

      *dons the asbestos underwear*

      I don't believe that the language supporting OOP requires you to write using OOP constructs. Haven't used PHP in a while, so I could very well be wrong.

      If the speed is the same for the majority of applications, it maintains all backwards compatibility, and it gets more users to develop in the F/OSS world... why not?

      --

      Proudly supporting the Libertarian Party.

    4. Re:Hmm by Drako2 · · Score: 0

      You can still write procedural code if you want to, nothing is stopping you, or forcing you into using the OOP methodology.

  5. Other books in this series by Neil+Blender · · Score: 5, Funny

    HTML Power Programming
    BASIC Operating System Design
    Enterprise AppleScript Applications
    Kernal Programming With Javascript

    1. Re:Other books in this series by kc0re · · Score: 5, Funny

      Power Shell Scripting with Bash
      RTFM for Manual readers
      How to click "Next, Next, Next, I Agree, Next, Next, Next, Finish" for Dummies

    2. Re:Other books in this series by Anonymous Coward · · Score: 0

      Power Shell Scripting with Bash

      Easy there, fella, thems fightin' words.

    3. Re:Other books in this series by ccoder · · Score: 1
      HTML Power Programming BASIC Operating System Design Enterprise AppleScript Applications Kernal Programming With Javascript
      You forgot to add:
      • Advanced Assembly Programming for Dummies
      • Learn Trusted Solaris Administration in 12 hours!
      --
      "During times of universal deceit, telling the truth becomes a revolutionary act" -- George Orwell
    4. Re:Other books in this series by Anonymous Coward · · Score: 0

      tcsh pwnz bash!

    5. Re:Other books in this series by Anonymous Coward · · Score: 0

      Power Shell Scripting with Bash

      One of these is not like the others..

      One of these does not belong...

      Seriously, most people don't realize just how powerful Bash is...

    6. Re:Other books in this series by sinserve · · Score: 1

      scsh, life on continuation ...

  6. Open Source series of technical books by Anonymous Coward · · Score: 3, Funny

    Cool, where do I go to download my free copy?

    1. Re:Open Source series of technical books by Anonymous Coward · · Score: 0
    2. Re:Open Source series of technical books by Anonymous Coward · · Score: 1, Informative
      You are going to have to waite a while for it. From the site http://tinyurl.com/69z9h (Prentice Hall PTR)

      The Bruce Perens' Open Source Series is designed to give a voice to up-and-coming Open Source authors. Each book in the Series is published under the Open Publication License, an Open Source compatible book license. Electronic versions will be made available at no cost several months after each book's publication.

  7. There is a backport available by Mustang+Matt · · Score: 2, Informative
    --
    The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
  8. Having read the book... by Anonymous Coward · · Score: 2, Informative

    This has been the most in-depth PHP book I've found to date. It covers alot of advanced web development techniques as well as good software design practices. "Advanced" PHP literature is hard to find, but this book does a solid job of providing it.

    1. Re:Having read the book... by Sokie · · Score: 2, Informative

      Another great PHP5 book that has been out for about a year now is George Schlossnagle's Advanced PHP Programming. I went out and bought it after hearing a couple of his talks last year and I'd say that chapter-for-chapter it is the most valuable/useful PHP Programming book I have ever seen. (Disclaimer: I haven't seen PHP 5 Power Programming yet.)

      If you want to learn about scaling a PHP application and making use of the new features in PHP5, I would heartily recommend buying George's book. Just check out the table of contents for an idea of what all is covered. I've especially appreciated the information about documentation generation, unit testing, and exception handling.

      --
      ------
      Where are the slash-groupies? I distinctly remember being promised slash-groupies!
    2. Re:Having read the book... by jmertic · · Score: 1

      Agreed, this is really the best programming book I've ever owned. It is more than a great PHP book, but a great software development book, as it covers things like coding standards, unit testing, error handling, source code management, and much more. I can't recommend this enough to any programmer, especially one moving to the "next step" with PHP coding.

      I heard him speak last fall in Toronto and he was the first person to ever make OOP sound practical to do in web projects.

  9. I'm using it. by Anonymous Coward · · Score: 0

    The new features have made php5 become aggressively adopted around here. We're cutting the line on php4 development and porting active projects to php5 to take advantage of some of the new OO features.

    A lot of our old code is terminally broken, but we're adopting php5 with open arms.

    I'm really glad the php team didn't decide to maintain 100% compatibility.

  10. christ by hyperstation · · Score: 1, Troll

    does the world really need another php book? what does this one cover that others don't? how many times can you rehash the real manual? i work in a place where 99% of development is in php, and you won't believe the idiots who read books like this one and are suddenly a "programmer".

    1. Re:christ by RaceCarDriver · · Score: 1

      What more does ANYBODY need besides php.net to learn, use and master PHP..?

    2. Re:christ by hyperstation · · Score: 1

      my point exactly.

    3. Re:christ by onlyjoking · · Score: 2, Insightful

      Get off yer high horse fer chreissake. So you're a REAL PROGRAMMER who probably drinks REAL ALE, wears a DEBIAN t-shirt and can recite LORD OF THE RINGS backwards. Some of us, meanwhile, are trying to learn to programme and this book, in case you didn't read the review, is considered best of breed.

    4. Re:christ by tweek · · Score: 1

      When you can take php.net into the bathroom or mark all over the pages, call me. I use php.net almost exlusively but alot of these types of books give a better explaination than the website for specific functions.

      --
      "Fighting the underpants gnomes since 1998!" "Bruce Schneier knows the state of schroedinger's cat"
    5. Re:christ by duncangough · · Score: 1

      Without wanting to hammer home the point - the php.net website really puts a lot of other languages to shame.
      Every built in function is available at php.net/whatever along with user comments and code snippets that are truly useful.
      For an open-source project, PHP earns a lot of credibility just by having something so basic. It's not the best documentation but it's more than enough to get you started.

    6. Re:christ by Anonymous Coward · · Score: 0

      Good call dude! I love it when slashdotters have nothing but bad things to say about any topic.

    7. Re:christ by Anonymous Coward · · Score: 0

      > the php.net website really puts a lot of other languages to shame.

      yeah, it's a real shame the language doesn't, however.

    8. Re:christ by tomhudson · · Score: 1
      Poster wrote:
      When you can take php.net into the bathroom or mark all over the pages, call me. I use php.net almost exlusively but alot of these types of books give a better explaination than the website for specific functions.
      ... laptops ...

      FTA:

      Databases are covered in depth in Chapter 6.
      hahahaha - come on - unless the one chapter is bigger than most books, there is no way it does an *in-depth* coverage of databases.

      Methinks the article is a bit trollish [tt].

    9. Re:christ by JabberWokky · · Score: 1
      Get off yer low horse fer chreissake. So you're a BEGINNING PROGRAMMER who probably is trying to learn to programme.

      Meanwhile, for people who use PHP for a living, there are no books out there. There are dozens of "Learn PHP" books on the shelf at my local Borders (I was literally looking through them *yesterday*), but none for advanced development issues or project management.

      Poor you. You have what you need. Damn him for lamenting his lack.

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    10. Re:christ by onlyjoking · · Score: 1

      "Advanced PHP Programming" by Schlossnagle has been out for quite a while. "PHP5 and MySQL E-Commerce" is also quite advanced. "Professional PHP5" (Apress). I don't see a lack of advanced PHP5 books.

    11. Re:christ by Anonymous Coward · · Score: 0

      Yes, my competitors do. Let 'em fumble around with PHP, and when the project nosedives, I'll come in and fix 'er up.

      Sometimes it doesn't feel right to replace a 3-page PHP program with a 3-line Ruby script (hello Rails!) that does more. But then the feeling passes.

    12. Re:christ by Anonymous Coward · · Score: 0

      php.net website really puts a lot of other languages to shame.

      Uhm, having a FLAT NAMESPACE for all your entire library isn't exactly something to be proud of..

      You do realize that Ruby (and Python too) have that kind of help available at the command line? Not only that, in Ruby's interactive mode (irb), you can use tabbing and command-line completion while inputting your programs. It will dynamically figure out what methods are available. PHP doesn't even seem to *have* an interactive mode.

      Oh but you can use php.net to figure out the difference between "!empty($var)", "isset($var)", "(boolean)$var", and "isnull($var)" and who knows what other variations. Yay.

    13. Re:christ by Anonymous Coward · · Score: 0

      No, the world doesn't need another PHP book. And yes I wish there was some kind of "programmer license" so there was at least *some* barrier to entry.

      Have you ever looked at the source code of programs like phpBB? *shiver* I wouldn't trust that on one of my servers. Here's a tip for all budding programmers: if your "if" statements are running off the right edge of the screen, you need to start creating some functions, mmkay? You know, "functions", the chapter of "Teach Yourself PHP In 15 Seconds" you haven't read yet even though you just landed an enterprise programming job?

    14. Re:christ by hyperstation · · Score: 1

      And yes I wish there was some kind of "programmer license" so there was at least *some* barrier to entry.

      i've run across the people you're talking about. they're employed where i work. sometimes i really don't know how they got hired...

      my job has offered to pay for employee's Zend certification, for whatever that's worth. i think that a real problem solving programming test and good response interpretation isn't a bad idea, for a company hiring developers. not something overly difficult, but looking for the very basics (and progressing).

    15. Re:christ by Tablizer · · Score: 1

      When you can take php.net into the bathroom or mark all over the pages, call me.

      I did, but now I can't get the pen marks off my laptop screen.

    16. Re:christ by hyperstation · · Score: 1

      Sometimes it doesn't feel right to replace a 3-page PHP program with a 3-line Ruby script (hello Rails!) that does more. But then the feeling passes.

      i agree. and at risk for going OT, i'll add that i'm only doing PHP at work, and in other for profit ventures. this is where i have to deal with other PHP developers and their associated skills (or lack of, sorry). don't get me wrong, i've work with some really great programmers.

      my personal stuff, which is to me where i really soak up new things and experience, is in something else. lately i'm down with using fastcgi+python for web apps.

    17. Re:christ by subtropolis · · Score: 1

      how many times can you rehash the real manual?

      It is the real manual, written by the lead developers. Did you miss the part about how this was about PHP5? You know, the new one...

      And what the fsck are you reading this thread for anyway, eh? Get back to yer sodding UML, we've got work to do, you prat.

      --
      "Our interests are to see if we can't scale it up to something more exciting," he said.
    18. Re:christ by JabberWokky · · Score: 1
      I went through the books at Borders as I do every couple months. The "Advanced..." and "Professional..." tend to cover things like how to use the GD image system or how classes work. In other words, very basic language stuff. Many of the "Professional..." with PHP and MySQL cover basic "How to use SQL" topics.

      If there's something regarding SQL, I want how to validate serialized objects in a Oracle database, not how to use CREATE TABLE to make a MySQL pricelist. And I really don't care so much about that - I'd rather have something about managing projects with a QA cycle that uses the PHP error logging system. That by itself would help the Dev/QA cycle, but we don't have the budget in time to toss a developer on building an in-house solution. In other words, I want a book about how to deal with real "I use this to put food on my table and pay people" issues.

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    19. Re:christ by Anonymous Coward · · Score: 0

      trying to learn to programme and this book

      Is "programme" a verb? I always thought it was a noun. Shouldn't it be "to program"?

    20. Re:christ by Anonymous Coward · · Score: 0

      nice moderating there...

  11. Thanks for the heads up! by Robotron23 · · Score: 3, Funny

    "The best way to be ready for the future is to invent it"

    So by PHP's reckoning.....

    1) Establish PHP
    2) "Invent the future"
    3) ????
    4) Profit!/Use your hovercar for daily commute

    1. Re:Thanks for the heads up! by Anonymous Coward · · Score: 0

      Situation is not so good for the user

      1. Install PHP
      2. PHP Crashes
      3. You spends all weekend babysitting and rebooting your server
      4. You get sued for specific performance on your dev contract, and lose.
      5. You die lonely and pennyless in the gutter, clutching your "PHP Developer" resume.

  12. Did you ever get the feeling that... by winkydink · · Score: 4, Funny

    one of the the primary reasons that things like PHP and Perl constantly change is so that guys like this can keep writing books and running training classes?

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

    1. Re:Did you ever get the feeling that... by Anonymous Coward · · Score: 0

      According to Lehman's laws of software evolution, if software doesn't change with its requirements it dies.

    2. Re:Did you ever get the feeling that... by winkydink · · Score: 1

      See Metcalfe's law in previous article.

      --

      "I'd rather be a lightning rod than a seismometer." -Ken Kesey

    3. Re:Did you ever get the feeling that... by Anonymous Coward · · Score: 0

      No, the reason they keep changing is they are not yet SmallTalk or Lisp.

      It's funny to see languages make the same motions over and over again. Well until you need to do a project in them.. then you weep and shake and wish you were paid by the hour.

    4. Re:Did you ever get the feeling that... by Anonymous Coward · · Score: 0

      Ah yes, the obligatory indignant Lisp hacker.

      (Who, since this is Slashdot, has probably never written any Lisp in his life.)

      Keep fighting the good fight.

    5. Re:Did you ever get the feeling that... by Anonymous Coward · · Score: 0

      PHP's functions are really badly (unconsistently) named and they indeed often change a lot of stuff making PHP4 applications return warnings or notices when run on PHP5.

      But isn't that supposed to be the challenge in programming? Don't we all love to say we know a programming language that's more "difficult" than BASIC some people know while they think they are the best at programming?

    6. Re:Did you ever get the feeling that... by Anonymous Coward · · Score: 0

      Nah, software drives software education. Users use the software, decide they want features added, it happens, developers add features and viola!

      New version, new books and training which explain the new features, and how to get the most out of them.

      Been working this way since software history began.

    7. Re:Did you ever get the feeling that... by Anonymous Coward · · Score: 0

      Hurr you're a retard because that was for special cases and on a totally didn't topic. Learn to read you nub.

  13. The secret to PHP programming by Anonymous Coward · · Score: 0

    Use short variable names because it makes the interpretter run faster. I wish I was joking.

    1. Re:The secret to PHP programming by tomhudson · · Score: 2, Interesting
      Use short variable names because it makes the interpretter run faster. I wish I was joking.
      ... and use a script to strip out all extra white space, line feeds, etc.
      ... and use make and cat to concatenate script fragments together rather than "include", "include_once", "require", "require_once", so as not to have to open a half-dozen files.

      ... but for development purposes, it's got a decent balance of features - enough so that I like it, and I'm a prick.

    2. Re:The secret to PHP programming by Anonymous Coward · · Score: 0

      Or you can just a scripting environment that caches opcodes, like ASP.

  14. Can anybody point me to a single, succinct document describing the difference between php 4 and 5? Something I can read while I eat this lovely cheese sandwich would be super.

    --

    --
    the strongest word is still the word "free"
  15. I have this book by j.a.mcguire · · Score: 3, Informative

    Seems to be really good, I think that fact that one of the authors (Zeev), who invented/develops the Zend engine speaks for itself.

    Covers lots of things even the basics, has some really good advice on form security and session security and explains how the hackers actually attempt to exploit loopholes in your forms and session data and how to get around this.

    Has a guide to generating bar charts/graphs which I found really usefull. Has good info on XML and SOAP, SQLi and multiple queries.

    It tends to have quite a beginners approach, but I'm not discrediting the book and dont let this put you off, the subject matter and topics covered make it more than worthwhile for php professionals and there is a wealth of information for migrators looking to use the new php5 (eg OOP) features.

    1. Re:I have this book by Anonymous Coward · · Score: 0

      I think that fact that one of the authors (Zeev), who invented/develops the Zend engine speaks for itself.

      The book is a badly designed clone of a similar Java book, is incomplete, has bugs, makes programming way too hard, yet is very popular?

      Sign me up!

  16. PHP5's abstract classes are good for namespacing by Anonymous Coward · · Score: 0

    It's not as elegant as real namespaces, but one can create abstract classes with public static functions to create a poor man's namespacing mechanism.

    Combine this with the magic __autoload() built-in PHP function and you can get rid of the mess of include()'s and require()'s. There is not much of a performance hit doing this, as a bonus.

    so instead of:

    include('common/functions.php');
    myFunc(...);

    you can just do:

    Functions::myFunc(...)

    and not worry where myFunc() comes from.

    This comes in handy when you have a complex directory heirarchy and use google-friendly URL's (e.g.: script.php/arg1/value1/arg2/value2) and have to do a lot of require(dirname(__FILE__).'/../../common/functions .php');

    Just my $0.02

  17. I just have to say... by SmokeHalo · · Score: 3, Funny

    ...bravo for using the word "adroitly". Don't see that one too often. :)

    --
    I'm not good in groups. It's difficult to work in a group when you're omnipotent. - Q
    1. Re:I just have to say... by lukewarmfusion · · Score: 1

      If you worked at Adroit Software, you would. I don't work there, but I imagine someone does. And that person would see "Adroitly" on a regular basis.</arguing_because_i_can>

    2. Re:I just have to say... by ciroknight · · Score: 1

      Good name for a company, IMO.

      --
      "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
  18. Re:ASP.NET by SQLz · · Score: 1
    Tell that to IBM

    ASP.NET might be faster but it only runs on 1 platform and its not even close to as widley deplpoyed as PHP nor is there that many free applications available written in ASP.NET to push adoption. For your own personal stuff or internal applications, sure ASP.NET is nice but if you want to write a web app for the masses, PHP is basically the only way to go.

    Also, In the last 6 months I've made close to $30,000 porting Access applications to the LAMP platform. Almost enough for a Mercedes!! Npting like telling a customer they don't have to buy any new servers or software. They usually end up spending more money adding features to the application.

  19. Re:PHP5's abstract classes are good for namespacin by Anonymous Coward · · Score: 0

    jesus christ stop wasting your time pretending to use perl and just it.

  20. John Scully! No way! by werdna · · Score: 1

    John Scully: "The best way to be ready for the future is to invent it,"

    Yeah, the sugar water king would ever have been that witty. Not only did John nearly butcher Apple, he didn't do much justice to the quote either.

    Conception credit for this particular inventive remark is usually attributed to Alan Kay, leader of the software group at Xerox PARC that gave us Smalltalk and so many pieces of the modern GUI.

  21. Good for Experienced OO programmers by hurricaen · · Score: 3, Informative

    I hadn't ever done any web programming before purchasing this book (about 2 months ago), but had plenty of experience with C++ and OO design. This book was perfect for me; it showed me how to do all the OO stuff I wanted to in PHP, and gave enough information about using sessions, post and get data etc to get started. After a week of tinkering I was off to the races!

    That said, I don't think this book would really do a good job showing someone how to use the OO features effectively who had never been exposed to it before, and that's probably fine. Just don't expect its half ass coverage of design patterns to give you a whole lot if you haven't scene them before.

    -K

    1. Re:Good for Experienced OO programmers by Tablizer · · Score: 1

      Sounds like you want a book dedicated to PHP OO. "Power" and OO are not necessarily the same in some people's eyes. But, let's not start that battle here.

  22. I'm Holding Out for PHP6 by WillAffleckUW · · Score: 0, Flamebait

    it fixes the bugs introduced in PHP5.

    --
    -- Tigger warning: This post may contain tiggers! --
  23. PHP5 projects by ikarus-fallen · · Score: 2, Informative

    PHP5 really is a nice step forward from PHP4. It's improved object support and exception handling make it easier to sell as a "real language" with management and clients. And PDO looks quite promising as well. Unfortunately, it is hard to find hosts that support PHP5.

    I've put together a set of componenets that I developed under a loose framework for PHP5, called phacade , that provide some of the conveniences of ASP.NET and JavaServer Faces, without all the headeaches those two technologies seem to include. phacade aims to provide components that can be used simply for simple projects, and as simply as possible for complex projects. Much like PHP itself, phacade is intended to work equally well for both procedural and Object Oriented scripts.

    If you're a PHP5 developer, please check it out and feel free to send feedback.

    Anyone else have any interesting PHP5 projects?

    1. Re:PHP5 projects by tweek · · Score: 2, Informative

      I've actually been planning on migrating our internal servers to 5 but I really need to revisit my code on alot of things.

      I used the simpler OO in version 4 everywhere so I want to make sure I don't break anything. My favorite libraries - adodb and smarty - have all been ported to 5 so I don't see any problems there.

      The biggest problem is support in some third-party apps we are looking at using. That and the fact that they don't freakin support postgresql which is where we're header with our internal databases for this type of stuff.

      --
      "Fighting the underpants gnomes since 1998!" "Bruce Schneier knows the state of schroedinger's cat"
    2. Re:PHP5 projects by fist · · Score: 1

      What makes you think php5 doesn't support postgresql?

      When building php5 ./configure --with-pgsql

    3. Re:PHP5 projects by flajann · · Score: 1
      I run a hosting service that supports PHP5. Indeed, I've been pleased with how easy it was to migrate to PHP5.

      Check out Hydranuke.com

      As far as PHP projects, I've created an extremely powerful E-Commerce system that is slowly evolving into a content manager. The system already is being used to host the operations of a $multi-million business. I do a lot of backend stuff that is not too apparent from the front-end.

    4. Re:PHP5 projects by Sxooter · · Score: 1

      uhhhm. I've got a workstation here at work. it's running apache 2.0 (process mode) with php5 and acccesses our Oracle and postgresql databases just fine. Or are you talking about the new PDB classes? Or the third party apps?

      Most third party apps will gladly accept patches that make pgsql work. i've submitted a few can still recal in the dark recesses of my memory a few times.

      --

      --- It is not the things we do which we regret the most, but the things which we don't do.
    5. Re:PHP5 projects by Anonymous Coward · · Score: 0

      Yeah, can you believe that Squirrelmail still doesn't work with php5?! They say it's fixed in CVS, but it ain't.

    6. Re:PHP5 projects by GigsVT · · Score: 1

      It's improved object support and exception handling make it easier to sell as a "real language" with management and clients

      Ah, finally someone who admits "OO" is just for buzzword compliance.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    7. Re:PHP5 projects by tweek · · Score: 1

      Actually I was talking about third-party code. I have no problem using pgsql and php ;)

      In fact I've got about 5 internal applications running that use it right now.

      I was thinking more along the lines of jrandom php package that seems really cool but has decided to use mysql_* throughout the code instead of something like adodb or peardb.

      --
      "Fighting the underpants gnomes since 1998!" "Bruce Schneier knows the state of schroedinger's cat"
    8. Re:PHP5 projects by tweek · · Score: 1

      Actually I was talking about third-party code. I have no problem using pgsql and php ;)

      I was thinking more along the lines of jrandom php package that seems really cool but has decided to use mysql_* throughout the code instead of something like adodb or peardb.

      --
      "Fighting the underpants gnomes since 1998!" "Bruce Schneier knows the state of schroedinger's cat"
    9. Re:PHP5 projects by Sxooter · · Score: 1

      oh yeah, I'm 100% with you on that. There's really no reason why a generic package like a bulletin board or what not should be using direct database functions like pg_, mysql_, or OCI_ ...

      It's not like the DB layer just showed up last week or something.

      --

      --- It is not the things we do which we regret the most, but the things which we don't do.
  24. Re:php5 by kc0re · · Score: 2, Interesting

    Litmus Test @ Monster.com

    I try to apply that Test when I feel dumb for putting stuff on my resume'.

  25. Probably. by jd · · Score: 1
    When was the last time you saw a program or a programming language "add a feature" that couldn't have been done by using extensions or pluggable modules?


    Generally, a full re-design should be rare. The English language has had three total re-designs in the past one and a half thousand years, and there are those who would argue that some of those were unnecessary. (The "Campaign for Real English" argue that standardized spelling, for example, was a bad idea.) All other changes have been incremental.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  26. Getting Free Electronic Versions? by MudButt · · Score: 1

    Prentice Hall PTR publishes each book under an Open Source book license and provides free electronic versions several months after each book's publication.

    Does anyone know where to obtain these free electronic versions of older books? I skimmed a couple Prentice Hall sites but couldn't find anything. Thanks!

    1. Re:Getting Free Electronic Versions? by phallstrom · · Score: 4, Informative

      Right here...

      http://www.phptr.com/series/series.asp?ser=335494

      Well, this is the main page. There's a link just after the intro.

    2. Re:Getting Free Electronic Versions? by UWC · · Score: 1
      http://www.phptr.com/series/series.asp?ser=335494

      That's the list of all the books in the "Open Source Series." They're listed newest to oldest. Looks like this PHP 5 one will probably be available soon. It was released in October, and a book released in July is available. The ones that are electronically available have links to the PDF in the "Downloads" section on the book's page. Though the very oldest few don't seem to have that.

    3. Re:Getting Free Electronic Versions? by xtrvd · · Score: 1

      The direct link to download them is http://www.phptr.com/promotion/1484?redir=1/

      Enjoy.

  27. Re:John Scully! No way! by snorklewacker · · Score: 1

    Yeah, the sugar water king would ever have been that witty. Not only did John nearly butcher Apple, he didn't do much justice to the quote either.

    The Newton was Scully's. It turned a profit when the rest of Apple was tanking.

    --
    I am no longer wasting my time with slashdot
  28. Thanks by bonch · · Score: 0, Troll

    Thanks for playing the role of "Angry, Anti-social, Elitist Perl Snob." The Slahsdot user known as hyperstation alone determines who is a programmer and who is not in this world, and goddammit, if you've read a PHP book, you're still not a programmer! You're not supposed to learn anything by reading about it in a book. Instead, you must know it through Slashdot discussions and online tutorials, or you're just not a "real" programmer. For instance, I learned Perl through osmosis by sleeping on an O'Reilly book. Brothers and sisters, I have arrived.

    1. Re:Thanks by hyperstation · · Score: 0

      Thanks for playing the role of "Angry, Anti-social, Elitist Perl Snob."

      actually, i don't use perl cuz it sucks (compared to another p language that isn't the topic of this story).

      i am merely suggesting that there are a sufficent quantity of PHP books on the market, and more do nothing to help the glut of "learn $language in 24 hours" programmers.

      the wheat must be seperated from the chaff.

    2. Re:Thanks by onlyjoking · · Score: 1

      Did you actually read the review? If you did you'd have to conclude that this is a book for advanced PHP programmers, not the "Learn x in 24 hours" you keep carping on about. The 2 authors are actually the leading developers of PHP and PEAR so what has this got to do with beginners' books? The book's title, in case you didn't care to note it, is "PHP5 Power Programming" not "Beginners Guide to PHP5". Every other review of this book I've read says there is very little in it for PHP beginners and that the book jumps straight into advanced topics ....... so there!

    3. Re:Thanks by hyperstation · · Score: 1

      yes, i read it - same old same old. i'm sure it's a wonderful book and all, but how many "leading developers of PHP" have to suddenly become authors?

    4. Re:Thanks by Anonymous Coward · · Score: 0

      Thanks for playing the role of "Angry, Anti-social, Elitist Snob." The Slahsdot user known as bonch alone determines who is a worthy poster and who is not in this world, and goddammit, if you've read "My Pet Goat", you're still not worthy to post here! You're not supposed to learn anything by reading about it on Slashdot. Instead, you must know it through Microsoft discussions and online tutorials, or you're just not a "worthy" poster. For instance, I learned about Longhorn through osmosis by sleeping on a Microsoft Press book. Brothers and sisters, I have arrived!

    5. Re:Thanks by Anonymous Coward · · Score: 0

      "PHP5 Power Programming" not "Beginners Guide to PHP5"

      What's the difference? How can such a simple language have any "power" features? Once you try and do anything powerful in it, you hit the brick wall and you jump to another language.

  29. PHP Engineer by Anonymous Coward · · Score: 0

    What exactly is a PHP Engineer?

    1. Re:PHP Engineer by Canberra+Bob · · Score: 3, Funny

      An oxymoron

  30. You sound like a religious zealot by Anonymous Coward · · Score: 0

    You remind me of this crazy religious fundamentalist who used to live next door to me. He was always ranting on and on about the people at his church, and how they weren't REAL Christians just because they read the Bible one day at Church. That guy's worldview really scared me, and so does yours.

  31. Perl whore. by Saeed+al-Sahaf · · Score: 0, Redundant

    Yet another person who should just come out and be honest about being a Perl whore.

    --
    "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
  32. Re:ASP.NET by Anonymous Coward · · Score: 0

    congratulations! You make $60,000 a year.

  33. Slightly Offtopic by PinkX · · Score: 1

    But since we're on the subject of PHP5, does anybody knows about PHP5 packages for Debian Sarge? Please don't tell me about dotdeb.org, I'd like something that works. I don't mean to troll here, but I'd love to start using PHP5 for our new webapps and our preferred development and deployment platform IS Debian Sarge.

    I had an email exchange with Ad Conrad, Debian's PHP Mantainer and he told me that as soon as Sarge is released as stable, he'd be uploading PHP5 to Debian. But it still seems to be far away.

    Regards,

  34. Coldfusion still wins my heart by hoggoth · · Score: 2, Interesting

    PHP5 sounds really great. I'd like to use it, really I would. But I am so spoiled by ColdFusion, especially the excellent database support.
    I was *shocked* when I found out PHP projects are coded for a specific database. In Coldfusion I can change database vendors merely by making a change on an admin page. All the Coldfusion code remains the same. Of course of you have to avoid non-standard SQL inside your queries.

    Is PHP database support anywhere near Coldfusion's?
    Not trolling, just would like to know.

    --
    - For the complete works of Shakespeare: cat /dev/random (may take some time)
    1. Re:Coldfusion still wins my heart by Monkey · · Score: 2, Informative

      There's ADOdb, a database abstraction layer for PHP. It supports a long list of different database drivers.

    2. Re:Coldfusion still wins my heart by PinkX · · Score: 1

      I've never seen CF code in my life, so I can't say if it's really better than PHP. Anyway, could you provide with some background info about the languaje, some code samples, or whatever it's necesary to show the supposed advantages of CF over PHP?

      Also, if I recall correctly, the ColdFusion server engine/component is not free, if that is the case is there any way to try it out?

      Regrads,

    3. Re:Coldfusion still wins my heart by m2pc · · Score: 1

      I used to code web applications in ColdFusion and switched to PHP a few years ago back when Version 3 was the latest. I have to say that I enjoy programming in a high-level language like PHP much better than CF. With CF all language constructs, etc are encapsulated in HTML-like tags.

      I honestly got tired of using < and > all the time while coding and found PHP to be refreshingly similar to C++ and JavaScript.

      In any language, it's a good practice to build an abstract DB layer anyway, even if the language doesn't support it natively. This way you can swap out the underlying DB more easily as your needs and those of your customers change.

      Sure, CF has some nice DB support but it costs a lot more and is less portable than PHP. Plus PHP is open-source while CF is built on a proprietary scripting engine. Also, it sounds like with PDO you get the best of both worlds - native DB abstraction and an open source scripting engine.

    4. Re:Coldfusion still wins my heart by pooh666 · · Score: 1

      This is a fundamental flaw in PHP, that Perl and Java and I would imagine other lang don't suffer. There is no attempt to do cross database coding with the defaults, and any kind of database support is a compile time option, like SO many other things in PHP. That esp I think is insane. Why in the hell should I have to recompile PHP to support postgress? I should be able to make the change as easily as you suggest, change the DBI drvier, or the JDBC driver. Which amounts to having the driver and a one line code change.

    5. Re:Coldfusion still wins my heart by Anonymous Coward · · Score: 3, Interesting
      Of course of you have to avoid non-standard SQL inside your queries.
      Do you also avoid language-specific coding just in case someone decides to switch your application to something other than Cold Fusion?
      There's another school of thought - opposite to yours and commonly encountered among experienced enterprise database application programmers - that says if you are not taking advantage of your database's features you are choosing to ignore some of the most powerful tools in your arsenal. This opinion arises from the fact that most large-scale "enterprise" applications are centered around a database schema. The database is not an afterthought, but rather plays a central role in the design and functionality of an application. In addition, a well designed database schema often outlives a single application and is commonly shared among multiple applications (I'm talking about business-critical data here).

      The "database-abstraction" argument is not very well thought out: which tends to have a longer life span - programming languages or databases? Well, you never know for sure. In my experience, however, RDBMS solutions tend to survive two or three generations of new programming languages in large corporations. For instance, one certainly can't argue that Cold Fusion is likely to outlive Oracle. So why the emphasis on "swapping out the database" when this might entail giving up critical features such as stored procedures, triggers, views, domains, rules, schemas, etc. ? None of these features are "non-standard SQL" as they are all part of various ANSI specifications but they are hardly supported by all popular databases (MySQL comes to mind).

      In answer to your question, use ADOdb or PEAR_DB if database interchangeability is a requirement for your application(s). If you're willing to trade solid relational design for the option to switch databases, you'll find it's just as easy to do with ADOdb as it is with Cold Fusion.

      In our PHP projects, we use a custom database abstraction API but not so much for the purposes of easily swapping out the database. What I consider far more important is establishing standard database calling conventions in the code and providing automatic protection from SQL injection attacks (i.e. prepared statements plus database and datatype-specific escaping/quoting). This does have the side-effect of not littering our code with mysql_query(), pg_query(), etc. which would of course make it far easier to switch databases if the need did arise. Of course, we would also have to redesign the schema, re-implement stored procedures, etc. and, being good database architects, we might want to rewrite a number of queries to take advantage of the new database's features.
    6. Re:Coldfusion still wins my heart by rycamor · · Score: 2, Insightful

      In addition to the many DB abstraction layers written in PHP, for years there has been a built-in module for DB abstraction called DBX. Unfortunately, it is not compiled into PHP by default, so you have to either re-compile PHP or load the module upon startup. Once you do that, you get high-performance cross-DB abstraction, with essentially all the speed of the standard DB-specific modules.

      It's a mystery to me why this hasn't been included in PHP by default. I even entered a request for this in the bug list, and was brushed off with the remark that "PDO is coming soon, and we would rather focus our attention on it". Oh well... I hope PDO is worth the wait.

  35. Re:php5 by Richthofen80 · · Score: 4, Interesting

    Say what you want, I've been getting job offers and phonecalls from recruiters looking for contractors to do LAMP projects, specifically in PHP. Most people are attracted to the virtually ZERO cost and crapload of free tools.

    For instance, I was actually asked to do an application for a client where scripting language and platform hadn't been decided. the mini-app had to generate images on the fly, include a search-engine style capability, etc. In ASP-land, I'd have to use an external DLL for the images and buy a searching script. In PHP-land, I used the built-in graphics library and phpdig. Although I think ASP.NET has its own built in graphics libraries, its simply much much harder to find free code for it. I know that might be an anathema to some, but why re-write barcode generating scripts or search functionality when a good alternative has already been written?

    --
    Reason, free market capitalism, and individualism
  36. php: tired, Ruby on Rails: WIRED! by CatGrep · · Score: 1

    Ruby on Rails is where it's at now. There's a quote on that page that compares php to programming in assembly compared to using RoR.

  37. Power programmers by Anonymous Coward · · Score: 0


    Would one of the "power programmers" please create a PHP calendar script that compares to Matt Kruse's Perl calendar? I've no talent in PHP (or any language for that matter), or I'd do it myself. After looking at dozens of PHP calendars, I've not seen one that compares to what Matt wrote.

  38. OO at last by rp · · Score: 3, Interesting

    I haven't read the book, and I don't intend to, but I do think the review gives a rather good assessment of what the shift to PHP 5 means in practice.

    I am personally of the conviction that OO is among those things that are absolute necessities to keep the work of mediocre (sloppy) programmers like myself moderately sane and structured, as soon as the number of lines exceeds throwaway level, say, 10,000 lines or more. I can't read my own code, let alone that of somebody else, if it's more than 10,000 lines and doesn't have a good class diagram as its basis, unless some other methodology was used, and those other methodologies are more problem specific than OO.

    Now I've seen (and luckily enough, managed to largely stay out of participating in) a project that was done in PHP4. Honest attempts were made (I swear) to separate user interface from business logic and to implement the latter in terms of an OO class design, but PHP wouldn't even let us *pass references as function arguments* without complaining. Which meant the OO support that was there was little more than shallow imitation. Which basically meant we couldn't implement the class design because the language wouldn't let us.

    As you may have guessed by now I'm also a fervent advocate of strong, static typing so I wouldn't trust myself with PHP 5 anyway, but it's good to know that they have at least managed to pass the hurdle of knowing what a reference is. It is (truly!) remarkable to see the power of open source in PHP, which has grown from a dirty hack of a Perl script to improve upon the even worse hack of Apache SSI, into a full-blown programming language, and I'd regard it as past its adolescence. The reviewer rightly points out XML support as a particular area in which previous versions of PHP lacked maturity. So it's getting there, but if you ask me: where exactly, I'll reply: where Java, NET and possibly some other languages are today.

    1. Re:OO at last by theTerribleRobbo · · Score: 1

      ... but PHP wouldn't even let us *pass references as function arguments* without complaining.

      You're meant to take references, rather than pass them, eg. the following takes $a by reference.

      $a = 'foo';
      my_function($a);
      echo $a;

      function my_function(&$a)
      {
      $a = 'bar';
      }
  39. The move is slow! by kuzb · · Score: 1

    We just switched over from php4 to php5. The result was that a few things broke, but it wasn't anything that couldn't be corrected.

    The major odvantages of PHP5 lay in it's new bundled features such as the improved object model, integrated simplexml (anyone who has had to deal with the other XML parsers will really appreciate this!), and sqlite. There is of course more, but I'll leave that for you to discover ;)

    Unfortunatly, it's not as easy for the newbies to install. Particularly where mysql is concerned because of the issues surrounding (the lack of) bundled client libraries for mysql. This has made it a little frustrating for us at #php/freenode, since we have to walk a lot of the new people through it.

    On a down-note, I sort of wish they had taken the plunge and broken backwards compatibility to fix some of the more perennial issues with php, like it's lack of consistant naming conventions, and lack of key OOP functionality. We still don't have proper namespacing, or argument overloading, or multiple inheritance.

    This book is probably a great idea for experienced programmers thinking of making the switch. Other good reading material: PHP5 OOP and Migrating from PHP4 to PHP5

    --
    BeauHD. Worst editor since kdawson.
  40. sure... by julioody · · Score: 1

    The only annoyance I see is what some people tend to call "the language evolution". Nowadays OOP seem to be the way to go even if the language has 1 or 2 purposes. If the cost for being similar to java (god knows why) is dropping simplicity, which in-lots-of-people-humble-opinion was (until 4) THE greatest feature of PHP, then the dev team deserves to burn in hell. Or better, as mentioned before in Slashdot (too lazy to look for the link), Zend is the reason for that.

    1. Re:sure... by inertia187 · · Score: 0

      "the language evolution"

      Also known as feature creep. Also known as, "if it can do this, why can't it do that?"

      This guy says there are some interesting benchmarks. That alone could jusify some companies to pick up the tab for you.

      --
      A programmer is a machine for converting coffee into code.
  41. PHP5 on Debian Sarge [was Re:Slightly Offtopic] by Attaturk · · Score: 1


    I've had no trouble with using this source on my sarge boxes, which are all running PHP5 and MySQL 4.1 with Apache 2 on the 2.6.8-10-amd64-k8-smp kernel. Actually they've been configured like that for quite a while now and have performed really well without incident.

    deb http://people.debian.org/~dexter php5 sid-old

  42. Upgrade to 'real' PHP5 difficult by datalife · · Score: 1

    In my experience it is difficult to support an PHP-App on both versions 4/5
    U have to switch compat-mode (zend..comp) on in php5.
    Why?

    in php4:
    function test(&$var) is callbyreference
    and
    function test($var) is callbyvalue

    in php5 without compat-mode you have to decide as the caller, since function-args are byreference

    test($var) byreference
    test($var.clone()) byvalue

    --
    There are only 10 types of people in the world: Those who understand binary and those who don't.
  43. Flamebait???? by badriram · · Score: 2, Interesting

    Why is the parent modded flamebait. S/he is telling the truth about PHP on IIS/Windows. It does have terrible performance compared to Linux/Apache. And it is not because of IIS or windows either. PHP, runs as an cgi on Windows, because of stability issues with the PHP ISAPI plugin.

    1. Re:Flamebait???? by Anonymous Coward · · Score: 1, Funny

      He got modded flamebait because he dared critize a white-hat hero of slashdot: the great PHP. The fact that he is right is of no consideration.

  44. Re:php: tired, Ruby on Rails: WIRED! by krumms · · Score: 1

    I started looking into Ruby on Rails late last night and from first impressions, I think you might be right.

    I've been working on a time tracking system for keeping track on work I do for clients etc. It took me over two hours to get the basics up and running with PHP (I've been a PHP developer for six years, four commercially).

    It took me ten minutes to do essentially the same thing in Ruby on Rails with no prior Rails experience and minimal Ruby experience.

    It's just a toy application at the moment, but Rails has sold me on Ruby as a rapid prototyping language for the web. With a little more prodding around to make sure it's this powerful for larger projects, it may very well become my language of choice.

  45. Hate to say this but... by 5n3ak3rp1mp · · Score: 1

    I was bugging my host to switch to PHP5, and then I recently discovered Ruby (and Rails), and am now bugging him to do that, since it is way more über than PHP, but there's even less of a chance of him going there anytime soon. =(

    1. Re:Hate to say this but... by Tablizer · · Score: 1

      I was bugging my host to switch to PHP5, and then I recently discovered Ruby (and Rails), and am now bugging him to do that, since it is way more über than PHP, but there's even less of a chance of him going there anytime soon.

      Unless Ruby Rails is the pinnacle of development, sounds like you will be bugging your host a lot in the future as new stuff comes out.

    2. Re:Hate to say this but... by ErikZ · · Score: 1

      Switch hosts already. It's not as if there's only one web host on the planet.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
  46. Go with stable PHP4 by MHobbit · · Score: 1

    I prefer the most recent, stable version of PHP4 (currently 4.3.10). Lots of apps I use, including phpBB, are much better off with PHP4. I'll wait a year or two before converting to PHP5.

    --
    Debugging? Klingons do not debug. Bugs are good for building character in the user.
  47. Singletons... by SlightOverdose · · Score: 1

    There's one thing thats been bugging me with PHP5; It doesn't seem possible to write a singleton that works with subclasses (self will return the parent class if you call it from a child). Anyone have a solution? (If not, I'd consider this proof that the php designers have no idea what they are doing).

  48. Re:PHP5's abstract classes are good for namespacin by Anonymous Coward · · Score: 0

    Heh, there's a lot of sentences I've uttered that go like this:

    "PHP's $FEATURE isn't as elegant/powerful/usable/readable as real $FEATURE, but since I've been forced to maintain this project, it'll have to do."

    Which of course raises the question, why on earth don't we use a language that has the real $FEATURE to begin with?

  49. Smarty by mikis · · Score: 1
    I would have liked to see some additional discussion and implementation of SMARTY in this chapter. SMARTY is a template engine with an ability to cache templates into PHP scripts which saves on overhead and contributes to speed and efficiency.

    But there would be no (or much less) overhead, and no slowdown if you didn't use Smarty :) Many people consider it too bloated. I prefer pure PHP templating engine like Savant: no need to reinvent the wheel (ie. PHP tags), no need to recompile templates, it is lightweight and fully PHP5 compliant.

    (Otherwise, nice review :))
    1. Re:Smarty by RealSalmon · · Score: 1

      Many people consider it too bloated.

      I concur. The trouble with Smarty is described perfectly in the "Philosophy" of the CPAN module Text::Template.

      If you apply the same philosophy to PHP and Template engines, then you'll see that Savant is a much more powerful choice.

      --

      -B

  50. Software Evolves by Anonymous Coward · · Score: 1, Interesting

    When software stops changing and improving it is most likely dead.
    I can see how a language like C can be solid for a very long time. But the only time things don't change is when people stop using them.

    In software we keep inventing new things and it is very prudent to document this newness. Hence we have new releases after a time so that the creators of these languages can give us better tools to use.

    It isn't a bad thing.
    And they need to make money so they write books.

    I like this model of technical development.
    Guess we have a lot to be thankful for when we live in an age that we can get free books in our house by typing wget in a command line.

    Count your blessings and write a book of your own.

    1. Re:Software Evolves by justins · · Score: 1
      When software stops changing and improving it is most likely dead.
      I can see how a language like C can be solid for a very long time. But the only time things don't change is when people stop using them.

      Come on, that is obviously not always true. Sometimes things don't change because the users are happy with the version they have and refuse to upgrade to the newfangled version which does not add anything they need.

      To put it another way, "change" and "improvement" are not always synonymous in software development, although they are often meant to be.
      --
      Now before I get modded down, I be to remind whoever might read this that what I am saying is FACT. - bogaboga
  51. Design Patterns by Anonymous Coward · · Score: 0

    Come on, no one expects design patterns to be interesting. They are like an ABC book for a kidergarden student.

  52. And that's how we win. by Sir_Real · · Score: 1

    Hook the developers, and they start peddling it in the corporations. Soon, the corporations can't give it up. Then they sell us their wives!

  53. Re:php: tired, Ruby on Rails: WIRED! by mikis · · Score: 1

    It does look very sweet... I'd like to know, how robust/scaleable it is compared to PHP? What are the major applications / web sites developed in Ruby on Rails?

    And is there anything remotely like PHP on Rails? :)

  54. Re:php5 by pooh666 · · Score: 1

    This is why I use Perl. http://cpan.uwinnipeg.ca/dist/GD-Barcode But it looks like it is not that hard to find PHP stuff either.. http://www.hotscripts.com/PHP/Scripts_and_Programs /E-Commerce/Barcode_Generation/ So I guess you didn't search very hard. This took me a solid 5 minutes. Barcodes are blindly simple, but if they are messed up, you can't do much about it with a closed source app, send it back, get a refund. Yeah, great. With these simple examples you can have full control and not have to be the victim of a bug you can't fix yourself. So harder must mean you can't use google and never heard of CPAN. And of course you can use Perl from PHP and as a result you have an outstanding collection of tools free and at your fingertips.

  55. Re:php5 by pooh666 · · Score: 1

    I realized as I posted my last message that I just totaly misunderstood you. My deepest apologies.

  56. Re:ASP.NET by SQLz · · Score: 1

    Thats just weekends, not counting my day job.

  57. tough to power program with no decent tools... by pocopoco · · Score: 1

    On the subject of power programming, does anyone know any refactoring tools for PHP? I inherited a god awful script to maintain the other day. It has some functions over 300 lines long, short and obscure naming of variables and functions, almost everything crammed in one file, etc..

    If it were in Java I'd be joyfully extracting methods and auto renaming stuff up the wazoo, but I can't find any refactoring tools for PHP. It's actually easier to just rewrite the damn thing than slog through by hand and unintelligent find/replaces.

    I checked PHPEclipse already, the only refactoring they have enabled is file renaming and that's broken (breaks all your include statements, etc.) so there's little hope there.

    1. Re:tough to power program with no decent tools... by Anonymous Coward · · Score: 0

      You may find phpxref helps: http://phpxref.sourceforge.net - it won't help with the replacing but it helps alot with the searching e.g. want to know all the places a particular global variable is referenced - no problem.

  58. Zend Cracks by Anonymous Coward · · Score: 0
    For what it's worth, andr.net has the following Zend cracks:
    Zend Studio (Client) 2.5
    Zend Studio 2.0 build 638
    ZEND STUDIO 3.0
    ZEND STUDIO 3.0
    Zend Studio 3.0.1
    Zend Studio 3.0.1
    Zend Studio 3.5.0 Beta
    Zend Studio 3.5.0 Final
    Zend Studio 3.5.0 Win32
    Zend Studio 3.5.1
    Zend Studio 3.5.2
    Zend Studio Client 2.6.1
    Zend Studio Client 3.0.0a
    Zend Studio Client 3.5.2
    Zend Studio Client 4.0.0
    Zend Studio Client and Server v2.5 for Windows & Linux
    Zend Studio Client for Windows 2.0
    Zend Studio Client Retail 2.5d
    Zend Studio Client v2.6
    Zend Studio Client v2.6.1.Linux
    Zend Studio Client v2.6.2
    Zend Studio Client v2.6.2.Linux
    Zend Studio Client v2.6.Linux
    Zend Studio Client v3.0.0a
    Zend Studio Client v3.0.1
    Zend Studio Client v3.0.1a
    Zend Studio Client v3.0.1a Linux
    Zend Studio Client v3.0.2a
    Zend Studio Client v3.0.2a Linux
    ZEND STUDIO CLIENT V3.5.1 LINUX
    Zend Studio Client v3.5.2
    Zend Studio Client v3.5.2 Linux
    Zend Studio Client v3.5.2 Mac
    Zend Studio Gold 3.0
    Zend Studio Server 2.01
    Zend Studio Server 3.0.0
    Zend Studio Server Retail 2.5d
    Zend Studio Server v2.6
    Zend Studio Server v2.6.Linux
    Zend Studio Server v3.0.0
    Zend Studio Server v3.0.1
    Zend Studio Server v3.0.1.FreeBSD40
    Zend Studio Server v3.0.1.Linux
  59. Just try Model 2 in PHP by iconara · · Score: 0

    Thank you for saying that. I browsed through the comments shaking my head, but finally someone said what was on my mind:

    It amazes me that people try to write big projects in PHP. It must be absolute hell. OO in PHP is just a joke. To me it seems like an afterthought, "hey, that OO thing seems popular, let's add some syntax sugar to emulate it in PHP". Because it's just that, syntax sugar.

    PHP works nicely for small sites, doing some quick and dirty hacks (but without having that nice quick-and-dirty-enabling syntax of Perl), and some simple database querying. It works, but just that.

    But try to implement Model 2 in PHP, the horror! (not to mention Model 2X...), it's simply not up to it.

    I've written small sites in PHP, works fine because I can do things quickly and without much thought. I've written medium-sized database-driven sites in PHP, and that gives me a headache. Trying to layer the application, abstract away the database and the subsystems, it's a pain. I do web programming for a living, and PHP is not even an option in most cases.

    Theo Hultberg / Iconara

    -- Hey, I've already got bad karma, so what can you do?

  60. Re:php: tired, Ruby on Rails: WIRED! by WWWWolf · · Score: 1

    Not sure about scalabity and such, but RoR people like to go on about how small and elegant it is... If it's half as small and elegant as they claim, I guess it's scalable then =)

    Basecamp is the slick pro site that was done in RoR. The Rails web site has a lot of other examples.

    There are MVC frameworks for PHP (a random example I just googled), though I'm fairly certain they're nowhere near as elegant as RoR. phpMVC sure doesn't seem so elegant...

  61. And behind door number one, Multithreading! by Anonymous Coward · · Score: 0

    Ok,
    So when is zeev going to get on the stick and start pushing developers to make their libraries threadsafe so PHP can run in a multithreaded web server?

    I really wish the php people would stop blaming apache for their own failure to cooperate with the developers of the libraries they use and either make them thread capable themselves, or convince the authors (money?) of the libraries to make them threadsafe.

    Til that happens, or php folks start developing thread safe versions of the libraries they build php interfaces for, PHP isn't quite there yet. Instead of focusing on adding features to PHP, they should do what they have to to make PHP a thread safe hypertext processor when used with the external libraries.

    l8,
    AC

  62. Re:php: tired, Ruby on Rails: WIRED! by Daath · · Score: 1

    Which is why the site you link to, use WordPress, a PHP weblog application. And it doesn't even work, I get a "can't connect to the database" error ;)

    --
    Any technology distinguishable from magic, is insufficiently advanced.
  63. Re:php: tired, Ruby on Rails: WIRED! by ciroknight · · Score: 1

    To me, Ruby on Rails doesn't look any better than PHP. I know Ruby's of all the rage overseas, but I truthfully believe that PHP's now in its prime and is ready to start maturing as an object oriented language. Now if the developers can get off their asses and speed it up, it'll be ready for perl-like situations.

    Let's face it kiddos. Perl's a great language, but is so write-only it makes my head spin. PHP is read/write, but is still very verbose, but just enough to the point where it's codeable. Ruby's alright, but just doesn't seem to be as rich or as fulfilling to code in. Parrot and Python are both great, but are really not suited for scripting on the web. Applications however..

    --
    "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
  64. PHP5 for Debian Sarge (Was Re:Slightly Offtopic) by jhereg69 · · Score: 1

    I had a lot of trouble trying to use any homebrew PHP5 package with Sarge; they all seemed to want Apache 1. I ended up just compiling from source. I wrote a description of the issues I had doing this; it may or may not help.

    --
    Never attribute to malice that which can be adequately explained by stupidity. -- Hanlon