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

Hybrid View

  1. #1
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 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,807
    Mentioned
    158 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
    808
    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 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.

  9. #9
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    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.

  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 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

  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
    SitePoint Addict
    Join Date
    Nov 2005
    Location
    Moss, Norway.
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeanco View Post
    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
    Why do you get an error if you define a variable with the name this in PHP 5? Is that allowed in PHP 4?

    You get a hint from (the introduction of ) this post:

    A soft introduction to object oriented programming.

  17. #17
    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.

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

  19. #19
    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 )

  20. #20
    SitePoint Addict
    Join Date
    Nov 2005
    Location
    Moss, Norway.
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mihd View Post
    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 )
    You can block IP (range)'s in .htaccess. That is on a lower level than in a php configuring file / script. I prefer .htaccess to those jobs on my phpBB powered forum.

  21. #21
    SitePoint Addict
    Join Date
    Nov 2005
    Location
    Moss, Norway.
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mihd View Post
    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 )
    I think namespaces will be implemented in PHP 6.0 and you can go around it and define your own:

    Google KW Search:

    namespaces php kgun site:www.webproworld.com

  22. #22
    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.

  23. #23
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,228
    Mentioned
    194 Post(s)
    Tagged
    2 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
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 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="^$">

  25. #25
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    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.


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
  •