SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best version of PHP to learn

    Hi all,

    This question has probably been asked many times before but I was wondering what would be the best version of PHP to learn as I will be looking to work with Wordpress and other PHP-based CMSs in the near future. I have enjoyed reading the ASP.Net Wrox book which I picked up from an auction website but am now looking at learning more front-end based languages such as PHP.

    However, having found a number of books I am a bit confused as to the version number I should pick up. Many books which are quite a bit cheaper cover version 4 though I wonder if it is worth spending more and getting the latest? The highest version number a book covers I have seen is 5.3.

    Any thoughts?

    Cheers!

  2. #2
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    The latest version of course is the best.
    But consider the version your web hosting currently has.
    5.3 is fine.
    Quality codes are optimized and tested...
    Click here for inspiration..

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,832
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    PHP 5.3 was released in 2009 and goes end of life next month.

    http://en.wikipedia.org/wiki/Php_5.3#Release_history

    Don't waste your time learning anything other than what the current version is. PHP 5.5. You can always check the documentation to see if a function or language feature is available to be used in a lesser version. But if you learn an older version, then you will have gaps in your knowledge and that is never a good thing.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,154
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    The only reason I would read an older version book is if it's free (eg. the public library) and only to skim through to get a feel for the basics.

    Definately not worth your time (and as has been said, may even be harmful) to go to any great depth learning functions that may take different arguments, have better alternatives or even no longer exist.

    Technology changes so fast that almost any book is already out of date by the time it's published, but you've got to start somewhere.
    I would suggest the most recent version you can reasonably afford, find out what version your host is running, then read the changelog/migrating documentation to see what's different before getting too deep into writing any code.

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,147
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Shoxt3r
    I have enjoyed reading the ASP.Net Wrox book which I picked up from an auction website but am now looking at learning more front-end based languages such as PHP.
    PHP isn't a front-end language it is a backend/server-side one. A small list of front-end technologies are HTML, CSS, and JavaScript.

    Quote Originally Posted by Shoxt3r
    I have enjoyed reading the ASP.Net Wrox book which I picked up from an auction website
    If you're familiar with c# or vb you shouldn't have much trouble picking up the syntax and basics of PHP. Though understanding the entire ecosystem comes down to practice.

    However, having found a number of books I am a bit confused as to the version number I should pick up. Many books which are quite a bit cheaper cover version 4 though I wonder if it is worth spending more and getting the latest? The highest version number a book covers I have seen is 5.3.
    Avoid version 4 since 4 is vastly different from 5. However, when it comes down to minor releases I would say anything covering 5 would be fine though preferably 5.2+ with a focus on oo programming.
    The only code I hate more than my own is everyone else's.

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    All the shared hosting providers I know of are now running PHP 5.4+ so that's the minimum you'd be looking at having any WordPress and CMS scripts running on.
    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="^$">

  7. #7
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,122
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cheesedude View Post
    Don't waste your time learning anything other than what the current version is. PHP 5.5.
    Oh come on, that is nearly impossible (from a book standpoint). So long as the book covers 5.X, you'll be fine.

    Quote Originally Posted by Shoxt3r View Post
    Hi all,

    This question has probably been asked many times before but I was wondering what would be the best version of PHP to learn as I will be looking to work with Wordpress and other PHP-based CMSs in the near future. I have enjoyed reading the ASP.Net Wrox book which I picked up from an auction website but am now looking at learning more front-end based languages such as PHP.

    However, having found a number of books I am a bit confused as to the version number I should pick up. Many books which are quite a bit cheaper cover version 4 though I wonder if it is worth spending more and getting the latest? The highest version number a book covers I have seen is 5.3.

    Any thoughts?

    Cheers!
    Skip books talking about PHP 4 as they'll likely reference mysql_* related functions instead of PDO/mysqli. Most PHP 5 books will cover PDO and/or mysqli, which will set you up much better going forward (the syntax in 4 and 5 are identical, there are additional functions, better OOP support, etc in PHP 5 that you won't find in PHP 4).

    For a quick intro into PHP, consider trying the online course at Code Academy (http://www.codecademy.com/tracks/php). It won't go over interacting with databases, but it will give you a quick intro to the syntax and resources available to you.

  8. #8
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,832
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by cpradio View Post
    Oh come on, that is nearly impossible (from a book standpoint).
    Point taken. PHP 5.5 was released almost a year ago. I would hope that is enough time for authors of existing books to add coverage of the latest version to new editions, or at least provide an addendum on their websites.

    I did not learn PHP by a book. I scrounged for information online as I needed it. The result was gaps in my knowledge. Trying to save a few dollars by learning an old, outdated version of PHP will do more harm than saving a few dollars will do good.

    PHP 5.6 is in feature freeze and release candidates are expected soon. So it may be finalized within a few months. PHP 5.3 will then be even more out of date.

    http://php.net/manual/en/migration55.changes.php

  9. #9
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,826
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Anything read in a hard-cover book will go out of date and possibly even be history by the time it takes to publish.


    I would be tempted to learn the basics and subscribe to numerous PHP Forums and also set some daily "Google Alerts" on PHP developments.


    I think but maybe wrong in the fact that if you looking to learn PHP to use on "Wordpress and other PHP-based CMS" software you will be resticted by the chosen software.


    Also unless you are able to upload the latest PHP version to your site, you will be restricted to the PHP version supplied by your Internet Service Provider.


    PHP basics can be learnt from this site:


    http://www.learnxinyminutes.com/docs/php/


    and to clarify all PHP features:


    https://php.net//manual/en/index.php

  10. #10
    SitePoint Enthusiast volter9's Avatar
    Join Date
    Jun 2014
    Location
    United States, CA
    Posts
    62
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Preferably to learn recent version of PHP, like PHP 5.5. I think you can learn PHP from php.net, but from my experience, better to start programming from other languages like Java or C++, because they teach how to program in the right way. Also

    Documentation:
    http://php.net/

    Some tutorials:
    http://www.w3schools.com/php/default.asp

    Good luck!

  11. #11
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,220
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by volter9 View Post
    Some tutorials:
    http://www.w3schools.com/php/default.asp

    Good luck!
    Although the basics can be learnt any way and I recongnize W3Schools' effort to teach all the technologies related to the web, and even like their schematic approach because it is easy to understand, short and direct... I'm one of those that will tell you to stay away from them.

    Unless this has changed recently, they don't have enough staff to keep it current and updated

  12. #12
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,122
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cheesedude View Post
    Point taken. PHP 5.5 was released almost a year ago. I would hope that is enough time for authors of existing books to add coverage of the latest version to new editions, or at least provide an addendum on their websites.

    I did not learn PHP by a book. I scrounged for information online as I needed it. The result was gaps in my knowledge. Trying to save a few dollars by learning an old, outdated version of PHP will do more harm than saving a few dollars will do good.

    PHP 5.6 is in feature freeze and release candidates are expected soon. So it may be finalized within a few months. PHP 5.3 will then be even more out of date.

    http://php.net/manual/en/migration55.changes.php
    I actually started PHP with a book (back in 1999). The book gave me a quick reference for syntax, language structure, etc that isn't always very apparent online (or at least wasn't then). I still usually get 1 or 2 books for each new language I want to adopt into my skill set, but I only use them for reference/a quick get to know the syntax from another person's perspective.

    Once they've done their job, I usually then hit up the language's website, forums, etc to expand my learning and correct any assumptions I may have made along the way. Once you have a foundation, keeping up with the language and the changes that occur between versions is a responsibility you just have to take on. PHP probably is the worst language when it comes to the time you need to devote to this process. It's constant version releases keep you learning new things about the language all the time.

    For comparison sake, take a look at .NET. The 4.0 framework was only recently updated to 4.5 a year or two ago! 5.0 probably isn't in the works for another year or two. And if you only want to look at when the CLR changed, that was back in 2010!

    I've primarily reached out to Sitepoint books when picking up a new language, the reason is because I just follow them better than other authors. I feel like they fit me better for getting a quick foundation set versus O'Reilly or similar authored books. Their PHP/MySQL series is good, I strongly suggest using that for a first introduction, and if you can swing it, go through some of the videos on Learnable too (so maybe get a 1 month subscription and try to spend 5-10 hours a week there).

    Just my 2 cents

  13. #13
    SitePoint Guru
    Join Date
    Nov 2003
    Location
    Huntsville AL
    Posts
    689
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Best version of PHP to learn? That of course would be the Python 3.x version. (Humor).

  14. #14
    SitePoint Member
    Join Date
    Apr 2014
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi all
    best version for php to learn is PHP 5.4 & PHP 5.5+

  15. #15
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Welcome to the forums

    Quote Originally Posted by dpespune View Post
    hi all
    best version for php to learn is PHP 5.4 & PHP 5.5+
    Why is that exactly?
    We value your input, but we don't want the thread to degenerate into a list of unsubstantiated claims about which version is best.

    The next reply that states "Version x is best" without any further reasoning will be fluffed.

  16. #16
    Non-Member
    Join Date
    Jun 2014
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can install PHP 5.3.0 latest version. I guess it will be the best version to learn PHP. Because you can get more feature in it.

  17. #17
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Been away for the weekend and come back to a great list of replies - thank you very much all!
    Sorry oddz, should have spotted that when posting - PHP is server-side not front-end - schoolboy error right there!

    I think I will be picking up a PHP 5.X (probably 5.5) book just so that I can study when away from an internet connection (e.g. on the train) and then fill in the gaps with tutorial videos / documentation on php.net

    Thanks again all! Would welcome any further suggestions

  18. #18
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Rajesh10 View Post
    You can install PHP 5.3.0 latest version. I guess it will be the best version to learn PHP. Because you can get more feature in it.
    But that isn't the latest version and a lot of hosting no longer runs that version having upgraded to a more recent one such as 5.4.3 or even 5.5.
    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="^$">


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
  •