SitePoint Sponsor

User Tag List

View Poll Results: What is your level of support for PHP 5?

Voters
140. You may not vote on this poll
  • I only write PHP 5 compatible code. I use PHP 4 only on PHP 4 servers.

    107 76.43%
  • I attempt to make my code compatible with PHP 4 whenever possible.

    19 13.57%
  • I only try to write PHP 4 code.

    14 10.00%
Page 1 of 4 1234 LastLast
Results 1 to 25 of 83
  1. #1
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    What is your level of support for PHP 5?

    I was curious as to how many of us are actually writing PHP 5 code nowadays. After reading that most of the major free/open source PHP script producers will be only officially supporting PHP 5.2+ as of February of next year I was wondering where that puts the rest of us in terms of support for it.

    All of my code is written in PHP 5 without concern for PHP 4 compatibility. I only write PHP 4 friendly code when I know the code will be run on a server that is only running PHP 4. What are you doing?

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    Stuck on PHP4 exclusively as the sites here (not written by me) are 4 specific and it would be a mammoth job to rewrite them all.

    There are plans to upgrade to 5 at some point but in the distant future
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I write for PHP4, but with 5 in mind - hopefully things would work on 5 without too much of a problem.

  4. #4
    SitePoint Wizard
    Join Date
    Jul 2004
    Location
    Minneapolis, MN
    Posts
    1,924
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just PHP5 for me.

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2007
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP 5 exclusively here.

  6. #6
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    809
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP5 here as well.
    Most of my clients are development agencies themselves, of which I know they run PHP5 servers.

    When talking to new clients, I try to make the hosting decision for them, so I know for sure the server supports PHP5.

    And actually, most of the bigger hosting companies in the Netherlands support PHP5 nowadays.

  7. #7
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Still supporting PHP4. I will pay the price to rewrite tons of code to PHP5, of course, but that was my strategic move. If I had to choose today, I would go with PHP5 and would not look back.
    Saul

  8. #8
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,561
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most of the code I write is for PHP 4. I can't use PHP 5 unless I know for sure that the server it's ultimately going to be deployed in supports PHP 5. Additionally, I always make the clients aware of this. Most still tend to settle for PHP 4 ( as in "we need apps, that is supported by most of the servers!"). I hardly have a choice.

  9. #9
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I am trying to run my first PHP 5 application that I bought from SitePoint called "Using Ajax with your web applications" but am having lots of problems trying to configure it to run on Windows XP and IIS.

    I have installed Apache2.2 and PHP php-5.2.3-win32-installer.msi

    I have made some changes and the last error message I got yesterday was this:

    No input file specified.

    I have tried to set the doc_root path in the .ini file to C:inetpub/wwwroot/finance/www and also delete it as I saw in some forums but to no avail.

    I have set my IIS alias to the "www" folder since it contains the index.php file. It also contains another file I do not know what it is used for (.htaccess) and I left it alone.

    http::/localhost/www

    Today, when I tried to open the file again in IE,

    http://localhost/www/index.php

    I got the following error:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, claudiop@kmrsoftware.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    I would appreciate very much if someone could help me to sort this problem out. What do I have to do to get the server back and running and get it to work with this PHP application?

    Cheers

  10. #10
    SitePoint Evangelist optl's Avatar
    Join Date
    Oct 2004
    Location
    Washington DC
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I am doing work for my own site then its PHP5. If I am working for a client it's almost always PHP4.
    For the phrase "Bethesda home architect", my clients
    websites occupy 6 of the first 8 results
    on the 1st page of Google. My Secret SEO Strategy Revealed

  11. #11
    SitePoint Addict
    Join Date
    Nov 2005
    Location
    Moss, Norway.
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Think ahead. Do you need a static ad site for your company or do you need a larger dynamic databasedriven site? PHP and MySQL are good enough even for many large company sites. The top of laziness is to do everything correct from the very start. Read what Matt Zandstra writes about being too fast.

    "The problem is that PHP is just too easy. It tempts you to try out your ideas, and flatters you with good results. You write much of your code straight into your Web pages, because PHP is designed to support that. You add the heavier code to functions in library files, and before you know it you have a working Web application.

    You are well on your way to ruin. You don't realize this, of course, because your site looks fantastic. It performs well, your clients are happy, and your users are spending money."


    Read more...

    That means that if you think of efficiency and code reuse etc. you ought to learn design patterns and object oriented programming.

  12. #12
    SitePoint Addict
    Join Date
    Aug 2005
    Location
    Lithuania, Europe
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP 5 only.

  13. #13
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP 5 Only. 4 is just too annoying. No __construct, modifiers, can't declare private, type cast. Just the very basic things that make code automation, reuse, and maintainability a reality aren't there in 4.

  14. #14
    I <3 Internet Tekime's Avatar
    Join Date
    Dec 2003
    Location
    Maine
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My software supports PHP 4.2+ and PHP 5. The reality is PHP 4 is still widespread and being exclusive to either is going to hurt your script.
    Scriptalicious SEO Scripts
    Save 20% with coupon code SPROCKS


  15. #15
    SitePoint Addict
    Join Date
    May 2005
    Location
    London, ON
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to let anyone know:

    If you want to ensure that your functions will still work in PHP5, the answer is in the error_reporting() you set
    Ryan Price
    Subscribe to my blog for regular tips and tricks

  16. #16
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I only use PHP 5 now. I'm addicted to PDO, which PHP 4 doesn't support. If a client's host doesn't have PHP 5 installed, I insist that they upgrade before I start the project.

  17. #17
    _ silver trophy ses5909's Avatar
    Join Date
    Jul 2003
    Location
    NoVa
    Posts
    5,467
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    same as you
    Sara

  18. #18
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    368
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php5 only for last 2 years, php5 is just waaayy better from a programming point of view, tho there are few things left desired such as namespaces.

    i also avoid apache specific functions and rewrites (because apache sucks compared to lighttpd / nginx )

  19. #19
    I hate Spammers mobyme's Avatar
    Join Date
    Apr 2004
    Location
    Sunny Snowdonia
    Posts
    662
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Strange that this should come up now. On Monday we took the decision to only work in PHP 5 and drop PHP 4.
    There are three kinds of men:
    The ones that learn by reading.
    The few who learn by observation.
    The rest of us have to pee on the electric fence.

  20. #20
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,598
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    I have had at least one person purchase one of my scripts that they wanted to have run on a server running PHP3 and so a few minor modifications to my code were needed for that implementation. The scripts work on all the PHP4 and PHP5 platforms that they have been installed on without any problems.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  21. #21
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm stuck on servers that only run PHP 4. I WANT to use (and learn) PHP 5, but the only one I have access to is my local development environment that was set up on my desktop PC using XAMPP.

  22. #22
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    About 5 months ago, when I decided to start future projects with the Symfony framework instead of my home-grown one, was when I officially abandoned PHP 4 compatibility.

  23. #23
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,433
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    version

    I have PHP version 5 on my server, so I use what's available. As thorough as I like to think of myself as being, I had a wake-up call when I wrote the error reporting plugin for WordPress and it crashed a user's blog (this was before the plugin sandbox). So I wrapped it in "if function_exists", put a "need ver 5+ for this feature" statement, and, knock wood, I've learned my lesson.

  24. #24
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I'm surprised the the responses so far. I never thought PHP had such support from developers. That leads me to believe that is support for existing PHP 4 scripts that is causing hosts to hesitate a move to PHP 5. I guess if the major players in open source/free scripts make the move to PHP 5 in February then we can expect to see a shift in webhosts' support for it. What kind of an effect do you think this shift will have on the uptake of PHP5 on webhosts and new PHP programmers?

  25. #25
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    368
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    developers mostly love and want php5, better object oriented support is a major plus

    the problem is Cpanel and Plesk, these are the bread and butter of the hosting industry...

    second problem are developers developing for the lowest common denominator -> PHP4, thus feeding back into the point i made above and making their own life's a lot harder as its a lot harder to write reusable code in php4 (and no copying and pasting paragraphs of spaghetti code is not reuse!) not to mention no access to some of the nicer advanced features and resources such as zend framework


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •