Slashdot Mirror


Introduction to PHP5

Yet Another OO Fanatic writes "PHP core developer Sterling Hughes has a excellent presentation (mirror) about PHP5 online. So far it seems to be the best coverage of the new features in PHP5; highlights include the new object model, namespaces, interfaces, access control and exceptions. Java by any other name..."

6 of 338 comments (clear)

  1. Re:new mysql by Christopher+Cashell · · Score: 5, Informative

    I don't know that "almost everyone uses php+mysql+apache".

    Personally, I much prefer php/perl+PostgreSQL+Apache. And I know I'm not the only one. Sometimes the most popular application isn't the best application (subject to your individual requirements, of course. . . but I've found PostgreSQL to be generally superior to MySQL for essentially all of my needs).

    Oh, and subselects have been working great for me for years now. ;-)

    --
    Topher
  2. Re:that thing was slashdotted with under 3 comment by Chester+K · · Score: 5, Funny

    Either most slashdot readers are now actually reading the articles

    It's a new feature of PHP5 ... Anticipatory Slashdotting.

    --

    NO CARRIER
  3. Nice and stable by Bob+Bobbinson · · Score: 5, Interesting

    From the blog :

    PHP5 isn't ready

    This is what I get for running a server on pre-alpha software.

    Ok, so as many of you already know, I have my talk for NYPHP online. This talk is hosted on NYPHP's servers, and is running Apache 1.3.27 + PHP5.

    PHP5 leaks worse than the titantic. With MaxRequestsPerChild at 100, apache children grew to 37MB (before we stopped counting). At MaxRequestsPerChild at 40, it was around 27mb. Finally, we've settled on a reasonable default 25 requests per child. MaxClients at 50.

    This is a box that can easily handle 20 times this load. ugh.

    PHP5 is pre-alpha. Don't think otherwise.

  4. Re:And, if you want it right now... by jasondlee · · Score: 5, Insightful

    Doesn't scale? I guess someone had better tell Yahoo.

    jason

    --
    jason
    Have a good day?! Impossible! I'm at work!
  5. PHP Is *not* an application server by tweakt · · Score: 5, Informative

    In PHP, all you have are scripts. Sure they may be optimized, compiled, pseudo-object-oriented and even obfuscated... but they are still scripts. They may even include eachother. But they are still *SCRIPTS*.

    After executing, they forget all knowledge. There is no persistence, no threading, no transactional support. All attempts to improve efficiency are afterthoughts and hacks.

    At one point I tried to implement in-memory "application" wide shared data. The concept is, something may need to be loaded when the site is first loaded, and then it should be kept in RAM, and we need exactly ONE instance of it.

    I gave up... using shared memory was too tricky and isn't even platform independent. It's not part of the core language, and even if it worked, it would not turn PHP into an application. It still runs in a modular fashion.

    Now with a Java servlet, you have an application that is running. Within your servlet you may define some data exist indepently of web requests. Servicing a request is just one aspect of it. Its much more like a real program, which is why it're referred to as an Application Server.

    For very simple things, that don't need to scale, both in usage, and codebase, then PHP is ok. But for design real web applications, which need to be managed by more than a few developers, integrate with legacy systems, implement a full three tier architecure, etc, PHP just doesn't cut it.

    A lot of the bad sites which go down easily when /.'d are simply bad coding. Making 16 database accesses per page is not bad when just a few people visit at once, but when the stampede comes, your toast. Most people don't develop with that in mind.

    Java has some serious strengths in the Web department, it's proven technology, and is not very complicated at all. It's just that most people aren't used to writing structured code. JAva forces you to follow somewhat good practices and the extra work pays off in maintainability. PHP and Perl you can just hack away, without any strong typing, etc and get something done very quickly but in the end it will become a mess quite fast.

    I'm not saying Java will solve your problems, but there is a strong base of best practices, design patterns and example code to help you keep your code in nice shape.

    With PHP, it seems like everyone has their own code libraries, utility scripts, ways of coding, etc and its really tough to resuse someone elses code. Java Interfaces and Inheritence comes in very handy.

    Ok... enough ranting. Anyway, I used to be a hardcore PHP supported because you could whip together things very easy, but as I learned more java and needed to do larger projects and learned more about efficient coding, I realized with PHP you will eventually just run into a wall and that's when it's time to look for better solutions.

  6. Re:yikes! by joab_son_of_zeruiah · · Score: 5, Insightful
    And what's with the java comment, PHP is pretty much nothing like java. ...
    I understood the sense of this remark to be more about the PHP's and Java's capabilities to access other software systems, rather than a comment strictly about the language. Check out the PHP reference manual. Sure, the language is the first few chapters. Then check out the other *100* chapters.

    One of the things I find fascinating when I compare the two at a system capability level is that they are equally capable. It's just that PHP is so much more easy to use, whereas Java is so much more orthodox. Easy to use often wins over orthodox.

    In the long run PHP has as much chance to be a Java killer as .NET does. In the great battle for free vs. proprietary software do I really need orthodox?