[PHP-DEV] Discussion - PHP with distributed programming features.

2023-10-27 Thread Kirill Nesmeyanov
To unsubscribe, visit: https://www.php.net/unsub.php   Hello! nginx connects to fpm using the fcgi protocol via sockets. All you need to do is create a socket with roundrobin (or like that), which will delegate the request to a specific fpm socket. Or don’t reinvent the wheel, since nginx itself copes with this (with balancing) perfectly in reverse proxy mode =))   -- Kirill Nesmeyanov  

Re: [PHP-DEV] Character range syntax ".." for character masks

2022-07-08 Thread Kirill Nesmeyanov
to explicitly mention in the documentation when >character range expressions are implemented and demonstrate their usage in >an example (not just as a user comment at the bottom; this isn't In-N-Out >Burger -- put your offerings on the frickin' menu!). > >mickmackusa     -- Kirill Nesmeyanov  

Re: [PHP-DEV] Multibyte strings

2022-02-11 Thread Kirill Nesmeyanov
d, for example, to format the output in the console (with utf support). So answering your question about "when" - the answer is simple: This will never be done, because these are functions for different tasks ;)     -- Kirill Nesmeyanov  

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-04 Thread Kirill Nesmeyanov
>Среда, 5 января 2022, 4:17 +03:00 от Larry Garfield : >  >On Tue, Jan 4, 2022, at 4:35 PM, Kirill Nesmeyanov wrote: >> Hello internals! >> >> Since «traits» are often an indicator of not very good code and many >> may not use them quite correctly, for example

[PHP-DEV] RFC: Trait expects interface

2022-01-04 Thread Kirill Nesmeyanov
do you think this idea/proposal is? And what possible problems or solutions will this entail in the future?   -- Kirill Nesmeyanov

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-01 Thread Kirill Nesmeyanov
  >Воскресенье, 2 января 2022, 8:20 +03:00 от Michael Morris : >  >On Sat, Jan 1, 2022 at 10:47 PM Kirill Nesmeyanov < n...@xakep.ru > wrote: > >> >> >Суббота, 1 января 2022, 17:41 +03:00 от Rowan Tommins < >> rowan.coll...@gmail.com >: >>

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-01 Thread Kirill Nesmeyanov
>Суббота, 1 января 2022, 17:41 +03:00 от Rowan Tommins >: >  >On 31/12/2021 00:21, Kirill Nesmeyanov wrote: >> I support this behavior fix because in its current form, due to a similar >> problem (almost?), all PSR-7 implementations contain bugs that violate >> R

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2021-12-31 Thread Kirill Nesmeyanov
>Пятница, 31 декабря 2021, 10:20 +03:00 от Christian Schneider >: >  >Am 31.12.2021 um 03:21 schrieb Kirill Nesmeyanov < n...@xakep.ru >: >> I support this behavior fix because in its current form, due to a similar >> problem (almost?), all PSR-7 implementat

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2021-12-30 Thread Kirill Nesmeyanov
side implementations, it is converted to a string and a problem arises ($message->getHeaders() // returns array instead of array). To solve this problem without BC, it seems to me that Nikita's idea with «declares» is most suitable, like: ``` int(42) } ```   -- Kirill Nesmeyanov  

Re: [PHP-DEV] Allow default parameters before non-default ones?

2021-12-14 Thread Kirill Nesmeyanov
>Вторник, 14 декабря 2021, 12:21 +03:00 от Rowan Tommins >: >  >On 13/12/2021 23:12, Kirill Nesmeyanov wrote: >> I'll add that leading optional parameters are needed to implement currying >> and partial application. >> >> ``` >> function foo(int $opt

Re: [PHP-DEV] Allow default parameters before non-default ones?

2021-12-13 Thread Kirill Nesmeyanov
While this is not a popular practice in PHP, this deprecation notification «breaks» all code that uses functional pradigm/concepts.   -- Kirill Nesmeyanov  

Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Kirill Nesmeyanov
xpr} is PHP's >general variable-variable syntax, which looks up the variable with name >returned by expr. The syntax also works inside strings in the form of >"${expr}". Using "${yield $v}" is just a specific instance of the general >pattern following the same rules. (This syntax has a special case that >should be deprecated: "${label}" will be interpreted the same as "$label" >instead, which is inconsistent with how it works everywhere else. This is >also why ${yield} without argument will not perform a yield and instead >look for a variable called $yield.) > >PHP unfortunately doesn't have a general expression interpolation syntax, >you can only interpolate variables and certain variable-like constructs. > >Regards, >Nikita     -- Kirill Nesmeyanov  

Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Kirill Nesmeyanov
  >Пятница, 8 октября 2021, 12:14 +03:00 от Kirill Nesmeyanov : >  > >  >Hello Internals! > >At the moment, there is a feature/bug in the PHP that allows to use >interpolation of generators. > >``` >$code = << Hello ${yield} >EXAMPLE; >``` &

[PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Kirill Nesmeyanov
ion of such a functionality is as follows: https://gist.github.com/SerafimArts/2e7702620480fbce6c24bc87bfb9cb0e I think it makes sense to do something about it. I have two suggestions: 1) Forbid using "yield" inside strings 2) Expect not a variable name as a result of this expression, but

Re[2]: Fwd: Re[2]: [PHP-DEV] PHP 8.1 enum const expressions problem

2021-07-30 Thread Kirill Nesmeyanov
>Пятница, 30 июля 2021, 16:45 +03:00 от Rowan Tommins : >  >On 30/07/2021 13:20, Kirill Nesmeyanov wrote: >> But in addition to bit-masks, there are also at least cases of addition and >> subtraction (the most popular). Can't we adapt all math expressions existing >>

Re[2]: Fwd: Re[2]: [PHP-DEV] PHP 8.1 enum const expressions problem

2021-07-30 Thread Kirill Nesmeyanov
//www.php.net/unsub.php   Yes, that's a good example. I agree. But in addition to bit-masks, there are also at least cases of addition and subtraction (the most popular). Can't we adapt all math expressions existing in nature to specific cases, thereby building our own pseudo-AST?   (Some::A + Some::B) * Some::C | Some::D; EnumSet of     - a: Some::D     - b: EnumMul of         - a: Some::C         - b: EnumSum of         - a: Some::A             - b: Some::B Imho, this is a hellish overcomplication. Isnt it?       -- Kirill Nesmeyanov  

[PHP-DEV] Tracking Object Property Changes

2021-03-10 Thread Kirill Nesmeyanov
Hello, Joseph! I faced exactly the same problems and believe that the Observer API is necessary. To solve a similar problem, I implemented my own API over FFI, however, it does not work very stable (I have little experience in send api), but it may help to solve your problems: