Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Rob Landers
On Thu, Jan 30, 2025, at 16:50, Tim Düsterhus wrote: > Hi > > Am 2025-01-29 21:16, schrieb Rob Landers: > > I understand what you are saying, but I can also just remove the > > warning via: > > > > $_ = outer; > > Please note that `$_` is a regular variable and thus will increase the > lifetim

[PHP-DEV] RFC karma request

2025-01-30 Thread xep...@list.ru
Hi! I’m looking for way to gain some Karma to create an RFC. I’ve already made first implementation and shared it: https://github.com/php/php-src/pull/17647 I can make 3 different RFC to discuss each change separately, let me know if it’s necessary. -- Best regards, Dmitrii Derepko.

[PHP-DEV] PHP 8.3.17RC1 Ready for testing

2025-01-30 Thread Jakub Zelenka
PHP 8.3.17RC1 has just been released and can be downloaded from: https://downloads.php.net/~jakub/ or https://qa.php.net/ or use the git tag: php-8.3.17RC1 Windows binaries are available at: https://windows.php.net/qa/#php-8.3 Please test it carefully, and report any bugs to https://github.co

Re: [PHP-DEV] RFC: First Class Callables in constant expressions

2025-01-30 Thread Larry Garfield
On Wed, Jan 22, 2025, at 8:35 AM, Tim Düsterhus wrote: > Hi > > Volker and I would like to start discussion on our RFC to support "First > Class Callables in constant expressions". > > Please find the following resources for your reference: > > - RFC: https://wiki.php.net/rfc/fcc_in_const_expr > -

Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Tim Düsterhus
Hi Am 2025-01-30 10:02, schrieb Rowan Tommins [IMSoP]: I think it would be good to explore alternatives - for instance, I think C# has a reserved _ variable to assign discarded results to, but may be misremembering. A quick search confirms that C# supports the `_` variable. It's also support

Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Tim Düsterhus
Hi Am 2025-01-29 23:48, schrieb Christian Schneider: I guess another option would be to define a function nop($_) {} and then use nop(outer()); but my question is whether $_ = outer() and nop(outer()) will be guaranteed to not being optimized in a way which causes the warning to

[PHP-DEV] PHP 8.4.4RC2 ready for testing

2025-01-30 Thread Calvin Buckley
PHP 8.4.4RC2 has just been released and may be downloaded from https://downloads.php.net/~calvinb/ Or use the git tag: php-8.4.2RC2 The reason why this is RC2 is because we caught a regression after tagging RC1. This includes the fix for that (from GH-17628) as well as a zlib-ng test regression f

Re: [PHP-DEV] [RFC] Introducing pm.max_memory for PHP-FPM

2025-01-30 Thread Arkadiy Kulev
Hello! This wouldn't really work because FPM does not control the script during > execution and would have to check it out after each allocation which is not > really viable. > Thanks for the feedback! I agree that monitoring memory usage after each allocation would be infeasible. However, my sug

Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Volker Dusch
Hi Matteo, On Thu, Jan 30, 2025 at 1:07 PM Matteo Beccati wrote: > > I reckon it's a nice thing to have, but to be honest I think handling it > just during static analysis would be the best approach. Also there would > be no need for a (void) cast to suppress the warning. > > We also discussed i

Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Tim Düsterhus
Hi Am 2025-01-29 21:16, schrieb Rob Landers: I understand what you are saying, but I can also just remove the warning via: $_ = outer; Please note that `$_` is a regular variable and thus will increase the lifetimes of returned objects (and arrays that can contain objects), which might or

Re: [PHP-DEV] [RFC] Introducing pm.max_memory for PHP-FPM

2025-01-30 Thread Jakub Zelenka
Hi, On Tue, Jan 28, 2025 at 2:17 AM Arkadiy Kulev wrote: > Hello everyone, > > I’d like to propose adding a new configuration directive, tentatively > called *pm.max_memory*, to PHP-FPM. This directive would allow > administrators to specify a per-child memory usage limit, after which the > PHP-

Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Matteo Beccati
Hi Tim, On 29/01/2025 16:12, Tim Düsterhus wrote: Hi Volker and I would like to start discussion on our RFC to allow "Marking return values as important (#[\NoDiscard])". Please find the following resources for your reference: - RFC: https://wiki.php.net/rfc/marking_return_value_as_importan

Re: [PHP-DEV] [RFC] Introducing pm.max_memory for PHP-FPM

2025-01-30 Thread Rob Landers
On Thu, Jan 30, 2025, at 17:41, Arkadiy Kulev wrote: > Hello! >> This wouldn't really work because FPM does not control the script during >> execution and would have to check it out after each allocation which is not >> really viable. > > Thanks for the feedback! I agree that monitoring memory u

Re: [PHP-DEV] [RFC] Introducing pm.max_memory for PHP-FPM

2025-01-30 Thread Arkadiy Kulev
> > To be honest, I haven't seen a 'slow' memory leak in a long time -- except > when using fgetcsv which has had a reported memory leak since ~2012 > somewhere on the old bug tracker. (I lost the link to it and don't even > remember how to get to the tracker or if it still exists.) I haven't > che

Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Claude Pache
> Le 30 janv. 2025 à 16:51, Tim Düsterhus a écrit : > > Hi > > Am 2025-01-30 10:02, schrieb Rowan Tommins [IMSoP]: >> I think it would be good to explore alternatives - for instance, I think C# >> has a reserved _ variable to assign discarded results to, but may be >> misremembering. > > A

Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard])

2025-01-30 Thread Rowan Tommins [IMSoP]
On 29 January 2025 22:48:03 GMT, Christian Schneider wrote: >I think the (void) cast is familiar for people from C or the like, the only >caveat is that it is not backward compatible, i.e. code using it won't work on >older versions of PHP so migrating to it is not seamless, so it probably