Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Saki Takamachi
Hi, Rowan I may have been thinking a little too much on the "technical side". Admittedly, my concern is in rare cases. OK, I understood that the problem is unlikely to occur in a realistic use case. Now, I'll just quietly watch this discussion. Regards. Saki -- PHP Internals - PHP Runtime

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

2023-10-28 Thread Jordan LeDoux
On Sat, Oct 28, 2023 at 4:35 PM juan carlos morales < dev.juan.mora...@gmail.com> wrote: > > > El El sáb, 28 de oct. de 2023 a la(s) 19:25, Jordan LeDoux < > jordan.led...@gmail.com> escribió: > >> >> >> On Sat, Oct 28, 2023 at 10:54 AM juan carlos morales < >> dev.juan.mora...@gmail.com> wrote:

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

2023-10-28 Thread juan carlos morales
El El sáb, 28 de oct. de 2023 a la(s) 19:25, Jordan LeDoux < jordan.led...@gmail.com> escribió: > > > On Sat, Oct 28, 2023 at 10:54 AM juan carlos morales < > dev.juan.mora...@gmail.com> wrote: > >> >> >> What I mean is more about … migrating a running php instance to another >> node or another

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

2023-10-28 Thread Jordan LeDoux
On Sat, Oct 28, 2023 at 10:54 AM juan carlos morales < dev.juan.mora...@gmail.com> wrote: > > > What I mean is more about … migrating a running php instance to another > node or another php instance, in fact your php code is running, suddenly we > Need to move to another node, how to do it? >

Re: [PHP-DEV] Re: Basic Type Alias

2023-10-28 Thread Alexandru Pătrănescu
Hey, So actually while reading this: On Fri, Oct 27, 2023 at 11:42 PM Oladoyinbo Vincent wrote: > And also, in order to group and namespace the Type Alias, i suggest we use > `typedef`, like i specify in my last message, it will be like this: > > File A.php: > > ```php > > namespace Package; >

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

2023-10-28 Thread juan carlos morales
El El vie, 27 de oct. de 2023 a la(s) 10:59, Kirill Nesmeyanov < n...@xakep.ru> escribió: > > >Пятница, 27 октября 2023, 14:38 +03:00 от juan carlos morales < > dev.juan.mora...@gmail.com>: > > > >Imagine a request comes to NgInx, then we process the request in PHP > > suddenly while

Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Rowan Tommins
On 28/10/2023 16:47, Saki Takamachi wrote: Yes, I'm assuming a timestamp that includes up to microseconds. This is because in the last example of the PR description, the microsecond timestamp was expressed as a float. Floating point numbers don't suddenly become unpredictable after a

Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Saki Takamachi
Hi Marc, > On a 64bit system it's obvious to have higher precision if you handle the > integer and fractions part separately (as timelib does) but this doesn't help > if you already have a floating point number at hand. Also JS uses a double > float for timestamps in milliseconds which is the

Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Marc
On 28.10.23 17:33, Rowan Tommins wrote: On 28 October 2023 15:40:29 BST, Saki Takamachi wrote: Hi Marc, Personally, I don't think these are necessarily necessary since there is a "from format". As noted on the PR, both the default constructor and createFromFormat require the input to be

Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Saki Takamachi
Hi Rowan, > I'm not sure where you got those numbers; on a 64-bit architecture (surely > the vast majority of PHP installs), a float can precisely represent any whole > number from -2**53 up to 2**53 - 1. As a Unix timestamp, that's a one-second > accuracy for any time 285 million years into

Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Rowan Tommins
On 28 October 2023 15:40:29 BST, Saki Takamachi wrote: >Hi Marc, > >Personally, I don't think these are necessarily necessary since there is a >"from format". As noted on the PR, both the default constructor and createFromFormat require the input to be converted to a string, which tends to

Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Saki Takamachi
Hi Marc, Personally, I don't think these are necessarily necessary since there is a "from format". However, there is certainly an issue of convenience, so I'm not against it if there's a demand for it. I have one concern. float is imprecise, so I don't think it's suitable for this kind of

[PHP-DEV] New DateTime[Immutable]::createFromTimestamp

2023-10-28 Thread Marc
Hi internals, I have opened a small PR to add the following functions at https://github.com/php/php-src/pull/12413 DateTime::createFromTimestamp(int|float$timestamp):static DateTimeImmutable::createFromTimestamp(int|float$timestamp):static

Re: [PHP-DEV] Basic Type Alias

2023-10-28 Thread Rowan Tommins
On 26 October 2023 23:35:56 BST, Deleu wrote: >I would love it if we could bring up a discussion on proposing changes to >the PHP Namespace system to allow for something more like ESM while >considering we don't have a build system and a hot-reload system, but I'm >just not sure if PHP Type

Re: [PHP-DEV] Re: Basic Type Alias

2023-10-28 Thread Aleksander Machniak
On 27.10.2023 22:42, Oladoyinbo Vincent wrote: ```php namespace Package; typedef MyTypes { type Numeric: int|float|null; type Chars: string|null; type Result: bool|null; } ``` ```php use Package\MyTypes; class Hello { use MyTypes; public function A(Numeric $id,