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 Build a Simple PHP Application Creating the Menu and Footer Starting the Project

date() has been deprecated / error message!

Date has been deprecated in PHP for a while now. If you follow the code in this video on a newer PHP builds (after 5.1.0, and 5.6.8 is now current) you will get an error message.

As far as I am aware it is only mktime() that has been deprecated as of 5.1.0 - I dont think they would deprecate one of the most core functions.

1 Answer

date() has not been officially or (as far as I know) unofficially deprecated in php version 5.

as Jayden Spring suggested, mktime() is an example of a deprecated function. You'll see a note in the php docs if this ever happens. E.g. in mktime():

As of PHP 5.1.0, this parameter became deprecated. As a result, the new timezone handling features should be used instead.

date has no such mention - are you quoting a particular reference, or is this something you've picked up in your code?