[PHP-DEV] rounding integers

2023-05-20 Thread Marc
Hi all, The "round" function supports rounding to significant digits before the decimal point which can be very helpful but unfortunately it's handling everything as floating point numbers which in the end can lead to inaccurate results.     printf("%d\n", round(987654321098765432, -1) //

Re: [PHP-DEV] RFC [Discussion]: Marking overridden methods (#[\Override])

2023-05-20 Thread David Gebler
On Thu, May 18, 2023 at 9:12 AM Marco Pivetta wrote: > > Would it perhaps make sense to have this in userland first, in phpstan or > psalm plugins, to see if there is interest? > 100% this in my view; this is exactly the kind of check which you would expect to be done at the static analysis

Re: [PHP-DEV] RFC [Discussion]: mb_str_pad

2023-05-20 Thread Niels Dossche
Hi Rowan On 5/20/23 17:13, Rowan Tommins wrote: > On 20 May 2023 13:53:20 BST, Niels Dossche wrote: >> RFC: https://wiki.php.net/rfc/mb_str_pad > > Hi Niels, > > This seems like a reasonable addition. My only hesitation is that it will > share with other mbstring functions the slightly

Re: [PHP-DEV] RFC [Discussion]: mb_str_pad

2023-05-20 Thread Rowan Tommins
On 20 May 2023 13:53:20 BST, Niels Dossche wrote: >RFC: https://wiki.php.net/rfc/mb_str_pad Hi Niels, This seems like a reasonable addition. My only hesitation is that it will share with other mbstring functions the slightly dubious definition of "character" as "code point", rather than

[PHP-DEV] RFC [Discussion]: mb_str_pad

2023-05-20 Thread Niels Dossche
Hello internals I'm opening the discussion for my RFC to implement mb_str_pad. RFC: https://wiki.php.net/rfc/mb_str_pad Implementation pull request: https://github.com/php/php-src/pull/11284 Kind regards Niels -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] [RFC] Property hooks, nee accessors

2023-05-20 Thread Erick de Azevedo Lima
I can't wait! Especially because I'm heading a modernization of the systems in my organization and my plan is to use the cutting edge PHP version for it. Currently our internal "framework" uses PHP 7.4, but with a PHP 5.6 coding style. Again: I can't wait! I can't do much but thank everyone who

Re: [PHP-DEV] Deprecation of the formats DATE_ISO8601 and DATE_RFC7231

2023-05-20 Thread Hans Henrik Bergan
>outdated format, standard has been changed while ago What do you mean? Do you mean that the constant was legal at some point? Was there ever a version of ISO8601 allowing the mixing of "extended format" and "basic format" ? The earliest version I've read, iso8604:2004, does not allow it (more on