View Single Post
Old 01-26-2013, 05:19 AM   PM User | #8
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
IMO its something that the older PHP versions did wrong. Or its possible that there was no easy way to create backwards compatibility with the existing procedural code and so there was no option but to write another set of functions to handle them. Both are good possibilities.
DateTime is 5.x functionality. The entire library is unstable between 5.0 and 5.3 where many new classes and methods were added. So the only frustrating thing is writing something on 5.3 which just doesn't work with say 5.2.8.
strtotime is also instable though as indicated by the changelogs. <4.4, next was listed as +2, <5.0.2 now was incorrectly calculated from midnight, and < 5.1.0 returns -1 on failure instead of false which is just silly since -1 is a valid time.

Compared to other languages, its hard to say. Most other languages I use you import to do many of the time manipulations. Before namespace (and even since due to backwards compatibility), php is stuck with only global symbols so it has dozens of functions for date and time.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote