Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Is there much difference between PHP 5 and the latest version of PHP?

I just bought a book on PHP and Mysql - I made the mistake of neglecting to check if it was a recent edition. Turns out, the book covers version 5 of both PHP and Mysql. Is it worth my time to read it, or has there been a lot of updates since?

Thanks

ps. If anyone could recommend a great php and mysql book, that would be great

1 Answer

PHP 7 has some pretty nice changes since php 5.4

1) It is significantly faster! 2) Scalar type hints and returns so you can tell your code what the code should look like when it enters a function as well as what to expect leaving the function. 3) A new comparison operator (<=>) that allows you to compare multiple (haven't found much use for it just yet myself) 4) A null coalesce operator (??) which I've used for specifying default values when certain things aren't set in my code.

<input type="name" value="<? $user->name ?? "John Doe" ?>"

Your current book should be fine though, I don't think there were many breaking changes.