Re: [PHP-DEV] [RFC] [Discussion] Measuring maximum execution time based on wall-time

2020-12-14 Thread Benjamin Eberlei
Hi Máté we talked about this before and I think it's a good addition. Two suggestions to improve the RFC: The RFC could include more details on how the behavior works exactly in combination with long running I/O. Lets say the default socket timeout being 60 seconds, andt the max execution wall ti

[PHP-DEV] capture_peer_cert support from stream_socket_server

2020-12-14 Thread Côme Chilliet
Hello, It seems that is does not work to pass option capture_peer_cert to stream_socket_server context in order to get the client certificate used in the TLS handshake. Is that how it is supposed to work, and is it broken? I tried the following: $context = stream_context_create( [

[PHP-DEV] [RFC] Short-match

2020-12-14 Thread Larry Garfield
I present to Internals this tiny RFC to follow up on the match() expression RFC from earlier in the year. There was solidly positive support for this shortcut previously but it was removed for simplicity at the time, with the intent to bring it back later. It's now later. https://wiki.php.net

Re: [PHP-DEV] Re: [RFC] Phasing out Serializable

2020-12-14 Thread Nicolas Grekas
Hi Nikita, > > > Picking up a loose thread: > > > https://wiki.php.net/rfc/custom_object_serialization introduced a > > > replacement for Serializable in PHP 7.4, so it's time to think about > > > deprecating and removing the old mechanism: > > > > > > https://wiki.php.net/rfc/phase_out_serializa

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Marco Pivetta
Hey Larry, On Mon, Dec 14, 2020 at 6:34 PM Larry Garfield wrote: > I present to Internals this tiny RFC to follow up on the match() > expression RFC from earlier in the year. There was solidly positive > support for this shortcut previously but it was removed for simplicity at > the time, with

[PHP-DEV] why doesn't file_get_contents() support LOCK_SH ?

2020-12-14 Thread Hans Henrik Bergan
given that file_put_contents() supports LOCK_EX -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Doug Nelson
Hi Marco, Is there any chance you can elaborate on why you feel it's a bad idea? Both you and Sara at different points have talked about thinking was bad practice, but I've not read anything compelling about why it should be considered as such. Kind regards, Doug Nelson On Mon, 14 Dec 2020 at 1

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Marco Pivetta
Hey Doug, On Mon, Dec 14, 2020, 21:24 Doug Nelson wrote: > Hi Marco, > > Is there any chance you can elaborate on why you feel it's a bad idea? > > Both you and Sara at different points have talked about thinking was bad > practice, but I've not read anything compelling about why it should be

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Olle Härstedt
Another situation in which _ might be useful. match (_) { ... } On Mon, 14 Dec 2020, 21:43 Marco Pivetta, wrote: > Hey Doug, > > > > > On Mon, Dec 14, 2020, 21:24 Doug Nelson wrote: > > > Hi Marco, > > > > Is there any chance you can elaborate on why you feel it's a bad idea? > > > > Both you a

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Sara Golemon
On Mon, Dec 14, 2020 at 2:24 PM Doug Nelson wrote: > Both you and Sara at different points have talked about thinking was bad > practice, but I've not read anything compelling about why it should be > considered as such. > > I'm not a full -1 on the concept (especially as match(true) has the conv

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Kamil Tekiela
I don't understand what's the advantage of the short match? Why would I ever want to use it? If I ever saw this kind of code in my codebase then I would immediately refactor it to use if statements. That is just abuse of match statement in my opinion. If someone wants to abuse match syntax like thi

Re: [PHP-DEV] [RFC] Enumerations

2020-12-14 Thread Paul Crovella
On Tue, Dec 8, 2020 at 10:14 AM Larry Garfield wrote: > > > Hi Paul. Although we're on hold for a bit while Ilija makes some changes in > direction (see previous email) I'm looking forward to seeing the results. > > Enumerations, as a general concept, are stateless. Or rather, the idea of >

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Andreas Leathley
On 14.12.20 18:33, Larry Garfield wrote: I present to Internals this tiny RFC to follow up on the match() expression RFC from earlier in the year. There was solidly positive support for this shortcut previously but it was removed for simplicity at the time, with the intent to bring it back la

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Björn Larsson
Den 2020-12-14 kl. 22:23, skrev Sara Golemon: On Mon, Dec 14, 2020 at 2:24 PM Doug Nelson wrote: Both you and Sara at different points have talked about thinking was bad practice, but I've not read anything compelling about why it should be considered as such. I'm not a full -1 on the conce

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Paul Crovella
On Mon, Dec 14, 2020 at 1:23 PM Sara Golemon wrote: > > On Mon, Dec 14, 2020 at 2:24 PM Doug Nelson wrote: > > > Both you and Sara at different points have talked about thinking was bad > > practice, but I've not read anything compelling about why it should be > > considered as such. > > > > > I'

[PHP-DEV] Re: [RFC] Phasing out Serializable

2020-12-14 Thread Björn Larsson
Den 2020-12-07 kl. 16:49, skrev Nikita Popov: On Mon, Dec 7, 2020 at 3:49 PM Björn Larsson wrote: Den 2020-12-07 kl. 15:11, skrev Nikita Popov: Hi internals, Picking up a loose thread: https://wiki.php.net/rfc/custom_object_serialization introduced a replacement for Serializable in PHP 7.4,

Re: [PHP-DEV] [RFC] Short-match

2020-12-14 Thread Andreas Leathley
I checked in my vendor directory for currently used switch(true) usages, there were 96 matches. It is often used when handling an unknown value and needing to display or convert it, as there the structure of a switch is easier to scan compared to other comparisons like ifs (at least it is for me).

Re: [PHP-DEV] Re: [RFC] Phasing out Serializable

2020-12-14 Thread Paul Crovella
> an RFC that mandates what should happen in 10.0, maybe > 10 years into the future feels a bit farfetched. It's more of a default unless another RFC changes the plan rather than a mandate. Given the plan here it seems a reasonable default. -- PHP Internals - PHP Runtime Development Mailing List