A simple PHP extension... wut?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
A simple PHP extension... wut?
« on April 5th, 2013, 12:22 AM »
So, while writing the infractions UI, it occurred to me that I'd quite like a feature I've seen in other languages, namely what C# calls the Math.Clamp (or under some cases, Math.Clampf because it's not loosely typed)

In other words, a function that brings this to being a core language feature:
Code: [Select]
function clamp($value, $min, $max)
{
     return min(max($value, $min), $max);
}

So I thought it might be nice to suggest it, it's a small language improvement, makes code more readable and whatnot and I'm put off for life. It's almost like the process is designed to reject external ideas. Adding a feature requires an RFC, https://wiki.php.net/rfc/howto which leads you to https://blogs.oracle.com/opal/entry/the_mysterious_php_rfc_process and I was like 'wut?'

It's stuff like that which means if I want to suggest what is conceptually to me a simple PHP feature, I'd have to learn C, learn PHP's inner code (I have some ideas, but not enough to get out and write this one off the bat) and submit it as a fully fledged patch. Yay.

I'm a little annoyed at the gamut but I do understand. It's sort of nice to be on the other side of the 'YOU KNOW WHAT WOULD BE COOL' debates for a change, sort of refreshing and grounding. But it doesn't feel nice.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,063

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A simple PHP extension... wut?
« Reply #2, on April 5th, 2013, 12:42 AM »
The difference is that at least there you could talk to people without having to spend several minutes even rummaging for somewhere to post. The SMF team at least has a 'feature requests' board, as opposed to the PHP people who have an RFC mailing list but you have to have karma before you can post there but it's not entirely clear how to earn karma >_<