PHP: date_sunrise - Manual: I don’t know how closely you all are looking at the PHP 5 function libraries, but I stumbled on this function today (and its sibling).
date_sunset() returns the sunset time for a given day (specified as a timestamp) and location. The latitude, longitude and zenith parameters default to the date.default_latitude, date.default_longitude and date.sunset_zenith configuration options, respectively.
The latitude defaults to North. So, if you want to specify a South value, you must pass a negative value. The same note applies to longitude, which defaults to East.
I love PHP, but I really wonder about things like this. We’ve talked before about some problems with the language (especially compared to Perl), like inconsistent function naming, and — as this function perhaps demonstrates — having too many functions in the core.
Isn’t this something that PEAR could have handled? Does this need to be built into the core? What percentage of PHP programmers have a need for this?
PHP in contrast to Perl: As much as I adore PHP, this article makes a lot of good points when comparing PHP to Perl: PHP has separate functions for case insensitive operations... PHP has inconsistent function naming... PHP has too many functions in the core I'll be the first to admit that…
I agree -- for ME this is really cool, but if you're going to have sunrise and sunset functions built into the language, how many million other things will there be?