Re: Introduction - Sam Lewis
On Sat, Feb 8, 2025, at 15:58, Tim Düsterhus wrote:
> Hi Sam
>
> On 2/8/25 15:30, Sam Lewis wrote:
> > they wished PHP had built-in functions for converting temperatures between
> > Fahrenheit and Celcius, and it seemed like a great small change to learn
> > how to contribute to PHP itself. So here I am!
>
> That's great. Adding functions definitely is the best way to get one’s
> feet wet with contributing to PHP itself.
>
> That said, PHP’s standard library is already pretty large and any new
> addition should provide value to a large number of projects, given the
> amount of work associated with it. A new function might conflict with
> existing userland functions having the same name, it needs to be
> documented (and documentation translated), it needs to be maintained for
> 20+ years and of course there's all the overhead of the RFC process.
>
> I'm not sure if functionality to convert between Fahrenheit and Celsius
> reaches that bar of usefulness and I doubt that an RFC proposing those
> would pass.
>
> I don't mean to discourage you from contributing and if you want, I
> would be happy to review your implementation even if you decide not to
> follow through with an RFC (ping @TimWolla on GitHub), perhaps it will
> be useful for any other functionality you might come up with in the future.
>
> And of course if you still plan to do the RFC that's also fine. But
> someone else will need to grant you the RFC karma, as I do not have the
> permissions to do so.
>
> Best regards
> Tim Düsterhus
>
Why stop at temperature though. It would (actually) be very useful to have a standard (built-in) way
for units conversion in-general. Not just for Celsius to Fahrenheit, but also Kelvin. Hours,
minutes, seconds, etc, as well. DateTime kinda-sorta handles time already -- if a bit clumsily..
— Rob
Thread (10 messages)