Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-05 Thread G. P. B.
On Thu, 4 Feb 2021 at 17:55, Benjamin Morel wrote: > On Thu, 4 Feb 2021 at 17:05, G. P. B. wrote: > >> Greetings internal, >> >> I'm proposing a new RFC which would warn when an implicit conversion >> from float to int occurs. >> >> The draft is currently located on GitHub: >>

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-05 Thread AllenJB
On 04/02/2021 17:54, Benjamin Morel wrote: On Thu, 4 Feb 2021 at 17:05, G. P. B. wrote: Greetings internal, I'm proposing a new RFC which would warn when an implicit conversion from float to int occurs. The draft is currently located on GitHub: https://github.com/Girgias/float-int-warning/

[PHP-DEV] Interaction between finally blocks and exit()

2021-02-05 Thread G. P. B.
Greetings internals, While working on rewriting the PHP docs about errors and error handling [1] I came across a change of behaviour in an edge case of an edge case. finally blocks are meant to be always executed regardless that an Exception has been thrown or not, which it does, however a call

[PHP-DEV] Inheritance Cache

2021-02-05 Thread Dmitry Stogov
Hi, I'm glad to present the result of my recent work - Inheritance Cache. https://github.com/php/php-src/pull/6627 This is a new transparent technology that eliminates overhead of PHP class inheritance. PHP classes are compiled and cached (by opcahce) separately, however their "linking" was

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-05 Thread Benjamin Morel
On Fri, 5 Feb 2021 at 11:56, AllenJB wrote: > (And after checking the manual, I'd also note here that round() also > returns a float, so how exactly does your example here work? Is it only > OK to explictly cast a float that's the return value of a function? Or > only explictly cast a float if

Re: [PHP-DEV] Inheritance Cache

2021-02-05 Thread Benjamin Morel
On Fri, 5 Feb 2021 at 15:03, Dmitry Stogov wrote: > Hi, > > I'm glad to present the result of my recent work - Inheritance Cache. > > https://github.com/php/php-src/pull/6627 > > This is a new transparent technology that eliminates overhead of PHP class > inheritance. > > PHP classes are

Re: [PHP-DEV] Interaction between finally blocks and exit()

2021-02-05 Thread David Gebler
Interesting. I'm not sure there's a "correct" answer here, but FWIW on balance my feeling is the expectation that exit() will immediately terminate a script (registered shutdown functions and destructors aside) should take precedence over the expectation that finally blocks will always execute,

[PHP-DEV] Re: Refactoring run-tests.php

2021-02-05 Thread Max Semenik
On Fri, Jun 5, 2020 at 6:41 PM Max Semenik wrote: > I was thinking about making some improvements to our venerable test > runner, however I wasn't feeling confident about improving the present code > base. Instead, I decided to attempt to refactor it. > > Here's my work in progress:

Re: [PHP-DEV] [VOTE] Enumerations

2021-02-05 Thread Dan Ackroyd
On Wed, 3 Feb 2021 at 17:29, Larry Garfield wrote: > > The vote on the Enumerations RFC is hereby opened. It will run until 17 > February 2021. The no vote for this is slightly higher than I was expecting. I understand that some people think enums should be 'just consts' and some people might

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-05 Thread Benjamin Morel
On Sat, 6 Feb 2021 at 00:46, David Gebler wrote: > Generating a warning on explicit casts of (non-integer) floats to int > would IMO make no sense at all, it would put PHP at odds with other major > languages such as C, Python and Java and go against normal, reasonable > expectations of how a

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-05 Thread David Gebler
> Floats (doubles) can accurately represent all integers up to 2⁵³, so there > is no inaccuracy in this range; the result from round() or floor() could > therefore be safely passed to (int) even if the cast operator checked for a > 0 fractional part, which is what I'm advocating for. Generating a

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-05 Thread Chase Peeler
On Fri, Feb 5, 2021 at 6:46 PM David Gebler wrote: > > Floats (doubles) can accurately represent all integers up to 2⁵³, so > there > > is no inaccuracy in this range; the result from round() or floor() could > > therefore be safely passed to (int) even if the cast operator checked for > a > > 0

[PHP-DEV] [VOTE] var_representation() : readable alternative to var_export()

2021-02-05 Thread tyson andre
Hi internals, Voting has started today on https://wiki.php.net/rfc/readable_var_representation and closes on 2021-02-19. This RFC proposes introducing a new function `var_representation` with the following differences from var_export: 1. `var_representation()` unconditionally returns a string