Re: [PHP-DEV] [RFC] Drop support for 32bit builds

2025-06-20 Thread Marc Bennewitz
On 19.06.25 18:55, Hans Henrik Bergan wrote: On Thu, Jun 19, 2025, 18:24 Ben Ramsey wrote: > On Jun 19, 2025, at 11:08, Calvin Buckley wrote: > > On Jun 19, 2025, at 11:08 AM, Marc Bennewitz wrote: >> >> Hi, >> >> During t

Re: [PHP-DEV] [RFC] Drop support for 32bit builds

2025-06-20 Thread Marc Bennewitz
On 20.06.25 10:15, Hans Henrik Bergan wrote: On Fri, 20 Jun 2025 at 09:15, Marc Bennewitz wrote: On 19.06.25 18:08, Calvin Buckley wrote: I think the biggest arguments against this would be: - embedded systems; think of PHP in use for i.e. router web UIs. While I suspect a lot of these are

Re: [PHP-DEV] [RFC] Drop support for 32bit builds

2025-06-20 Thread Marc Bennewitz
On 19.06.25 18:08, Calvin Buckley wrote: I think the biggest arguments against this would be: - embedded systems; think of PHP in use for i.e. router web UIs. While I suspect a lot of these are going to be i.e. AArch64/RV64 in the future, there might be a long tail of existing systems. Of cours

[PHP-DEV] [RFC] Drop support for 32bit builds

2025-06-19 Thread Marc Bennewitz
Hi, During the discussion about the year 2038 issue it turned out that maybe it's time to drop support for 32-bit of PHP completely. Based on that I have created an RFC to deprecate 32-bit build in 8.next and drop support for it in 9. RFC: https://wiki.php.net/rfc/drop_32bit_support Ope

Re: [PHP-DEV] Year 2038 issue

2025-06-18 Thread Marc Bennewitz
On 16.06.25 19:01, Yogarine wrote: Hi all, On 16 Jun 2025, at 17:24, Rob Landers wrote: On Mon, Jun 16, 2025, at 16:54, Alexandru Pătrănescu wrote: On Mon, Jun 16, 2025 at 4:03 PM Marc Bennewitz wrote: Hi all, It's 12.5 years only until the timestamps in PHP on 32bit will not wo

Re: [PHP-DEV] Year 2038 issue

2025-06-16 Thread Marc Bennewitz
On 16.06.25 17:21, Rob Landers wrote: On Mon, Jun 16, 2025, at 16:54, Alexandru Pătrănescu wrote: On Mon, Jun 16, 2025 at 4:03 PM Marc Bennewitz wrote: Hi all, It's 12.5 years only until the timestamps in PHP on 32bit will not work as expected anymore. Hi, I think

Re: [PHP-DEV] Year 2038 issue

2025-06-16 Thread Marc Bennewitz
On 16.06.25 16:16, Kamil Tekiela wrote: Why do you say that these functions do not work with year 2038? https://3v4l.org/61VLh I wouldn't be opposed to deprecating them, but I don't know if we have a good enough reason to do so. https://3v4l.org seems to be 64bit now ;) -> https://3v4l.org/1F

[PHP-DEV] Year 2038 issue

2025-06-16 Thread Marc Bennewitz
Hi all, It's 12.5 years only until the timestamps in PHP on 32bit will not work as expected anymore. The DateTime[Immutable] classes use 64bit integers internally already but there are still a couple of places where this is an issue in the API due to PHP integer limit: Based on that I pers

Re: [PHP-DEV] Allow hooks in `readonly` promoted properties

2025-06-04 Thread Marc Bennewitz
s you noted in your RFC: > On the other hand, there is no shortage of dumb things that people can do with PHP already. The exact same silliness could be implemented using |__get|, for instance. ... --Larry Garfield Thanks, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

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

2025-03-03 Thread Marc B.
ed to not end up in a situation that such optimization would be useful but can't be applied as of this feature.Kind Regards,Volker Regards,Marc

Re: [PHP-DEV] Enum + property hook getter

2025-02-08 Thread Marc Bennewitz
Hi Tim, Unintentionally, I first replied to Tim only but it was meant to be send to the list. On 07.02.25 16:11, Tim Düsterhus wrote: Hi Am 2025-02-07 16:03, schrieb Marc Bennewitz: Is that something feasible and how complicated would that be to implement? Supporting this might cause

[PHP-DEV] Enum + property hook getter

2025-02-07 Thread Marc Bennewitz
>name, 3);     } } Means, allowing get-only property hooks on enums reducing the need to write "old school" getter methods. Is that something feasible and how complicated would that be to implement? Best, Marc Bennewitz OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key

Re: [PHP-DEV] Pattern matching details questions

2025-02-04 Thread Marc Bennewitz
ould be: $value is int and &$x Which removes the confusion you mentioned before (also for someone like me who uses bitwise-and quite a bit). — Rob Is it possible to use the already added "is", like: $arr is ['a' => $a, 'b' => is $b] Or, to use the already known uniform variable syntax "{$var}", like: $arr is ['a' => $a, 'b' => {$b}] Best, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] Empty subject in match and switch constructions

2025-02-04 Thread Marc Bennewitz
al one in this case) Additionally, if you really what to compare empty vs. non empty you can use empty to make it explicit. Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

[PHP-DEV] Idea: Inline enum

2024-12-19 Thread Marc Bennewitz
What do you think?    Does that make sense?    Is that implementable? Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

[PHP-DEV] DatePeriod microsecond support

2024-08-21 Thread Marc Bennewitz
y ask if this can be merged to be included in 8.4 or if I should do something else? [1] https://github.com/php/php-src/issues/13773 [2] https://github.com/php/php-src/pull/14581 Thanks, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: Op

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.4

2024-07-01 Thread Marc Bennewitz
y be beneficial to have this sooner than later. What do you think? Best regards, Gina P. Banyard Best, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-21 Thread Marc Bennewitz
ching which opens up another question: Could we have an interface allowing objects to match in a specific way?     interface Matchable {     public function match(mixed $value): bool;     } Thanks for working on it! Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] Re: [RFC] [Discussion] Add openStream() to XML{Reader,Writer}

2024-05-12 Thread Marc B.
Am 11.05.2024 11:09 schrieb Niels Dossche :On 11/05/2024 08:38, Marc B. wrote: > Hi Niels, > > Am 10.05.2024 19:38 schrieb Niels Dossche : > > On 10/05/2024 16:31, Larry Garfield wrote: > > On Fri, May 10, 2024, at 2:03 PM, Niels Dossche wrote: > >&

Re: [PHP-DEV] Re: [RFC] [Discussion] Add openStream() to XML{Reader,Writer}

2024-05-10 Thread Marc B.
tantiated object. What does it open?And what happens on calling openStream in a middle of reading/writing an XML document.What happens on calling openStream stream after calling open - does it read/write from/to both?Best,Marc Kind regards Niels

Re: [PHP-DEV] [RFC][Vote announcement] Property hooks

2024-04-12 Thread Marc Bennewitz
ldProp); // string(0) "" $t->oldProp = 'bar'; var_dump($t); // { ["newProp"]=> string(10) "backed:bar" } var_dump($t->newProp); // string(3) "bar" var_dump($t->oldProp); // string(0) "" Kind regards, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

[PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-04-02 Thread Marc Bennewitz
Hi internals, On 17.03.24 13:23, Marc Bennewitz wrote: Hello internals, I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Do to Easter weekend the vote will run for two weeks and two days until Tue the 2nd of April 2024. T

Re: [PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-22 Thread Marc Bennewitz
Hi Bob, and sorry for the late reply ... On 19.03.24 01:05, Bob Weinand wrote: Hey Marc, On 18.3.2024 08:53:01, Marc Bennewitz wrote: Hi Bob, On 17.03.24 14:59, Bob Weinand wrote: On 17.3.2024 13:23:04, Marc Bennewitz wrote: Hello internals, I have opened the vote for the "Rou

Re: [PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-18 Thread Marc Bennewitz
value." this is already noted in the RFC and the functions will be a no-op in this case. Best regards, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-18 Thread Marc Bennewitz
Hi Bob, On 17.03.24 14:59, Bob Weinand wrote: On 17.3.2024 13:23:04, Marc Bennewitz wrote: Hello internals, I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Do to Easter weekend the vote will run for two weeks and two days

Re: [PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-17 Thread Marc Bennewitz
On 17.03.24 14:10, Tim Düsterhus wrote: Hi On 3/17/24 13:23, Marc Bennewitz wrote: I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Please also update the Status within the RFC itself and move it to the correct section

[PHP-DEV] [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-17 Thread Marc Bennewitz
Hello internals, I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Do to Easter weekend the vote will run for two weeks and two days until Tue the 2nd of April 2024. Best regards, Marc Bennewitz OpenPGP_0x3936ABF753

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-10 Thread Marc Bennewitz
, the return value has the same type as /number/. ... but in python int is limited only by memory and not by the type which makes it very different. I have added a description and updated example in the RFC. Best, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

[PHP-DEV] Idea: Implicit inheriting function argument & return type-hint

2024-03-08 Thread Marc
} That do you think? This is just something that come to mind without having the knowledge nor time for this kind of RFC or implementation. Greetings, Marc

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-08 Thread Marc
0 via new parameter "force_float". Also the deprecation has been removed as nobody liked it. If no further comments arrive I'll like to start voting next week Friday. Best regards, Marc On 25.02.24 18:09, Marc Bennewitz wrote: Hi all, I now have updated the RFC to allow to opt-i

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-02-25 Thread Marc Bennewitz
Hi all, I now have updated the RFC to allow to opt-in to new behavior on PHP 8.4 and be able to opt-out to previous behavior in PHP 9.0 via new parameter "force_float". Also the deprecation has been removed as nobody liked it. Best regards, Marc On 26.09.23 12:39, Marc Bennewitz

Re: [PHP-DEV] [RFC][Discussion] Raising zero to the power of negative number

2024-02-25 Thread Marc Bennewitz
n your RFC. About `fpow` - I personally never felled the need to use `fdiv` but as `fdiv` was explicitly introduced to expose IEEE-754 semantics I think it totally makes sense to add `fpow` as well. Greetings, Marc Kind regards, Jorg OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-23 Thread Marc Bennewitz
ambiguous. What happens if you declare `set($field) {}` ? Does such construct let the engine set the property value immediately as the input value gets immediately assigned to the property via $field? Greetings, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] Requesting RFC karma

2024-02-20 Thread Marc Bennewitz
On 20.02.24 09:58, Derick Rethans wrote: On 20 February 2024 08:41:19 GMT, Marc Bennewitz wrote: Hi Hans, On 16.02.24 13:05, Hans Henrik Bergan wrote: My name is "Hans Henrik Bergan", usually go by the nickname "divinity76", I've contributed to OSS (includi

Re: [PHP-DEV] Requesting RFC karma

2024-02-20 Thread Marc Bennewitz
on defined parts needs to be explicitly reset using `|!` * leap seconds support on UTC TZ   * As of leap seconds ... wouldn't it be better to default to +00:00 instead of UTC ? * Support nanoseconds I'm for sure not able to work on all these points and that's why I only started

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

2023-10-29 Thread Marc
On 29.10.23 19:41, Marc wrote: Hi Saki, On 28.10.23 18:32, Saki Takamachi wrote: 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

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

2023-10-29 Thread Marc
Hi Saki, On 28.10.23 18:32, Saki Takamachi wrote: 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 use

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

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

2023-10-28 Thread Marc
):DateTime date_create_immutable_from_timestamp(int|float$timestamp):DateTimeImmutable I hope this does not require an RFC, but I'm not sure so I'm writing here to get some thoughts. Thanks, Marc

Re: [PHP-DEV] Basic Type Alias

2023-10-26 Thread Marc
id(mixed $var): bool $refl = ReflectionClass(UserId::class); $refl = ReflectionType::from(UserId::class); ... Best, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Custom object equality

2023-10-24 Thread Marc Bennewitz
years ago Sara was working on it, too ;) https://externals.io/message/21883 Jordan Best, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-19 Thread Marc Bennewitz
Hi, On 26.09.23 12:39, Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding Best, Marc Based on the discussion I see two groups. The one that would like to change this behavior without message (bug fix) and others tha

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-19 Thread Marc Bennewitz
not outweigh it's overhead. On the same time the results can be improved without adding overhead. Regards Jakub Best, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-15 Thread Marc
gister all functions? Also what would happen in this case with functions included later? Would they also be callable or only the functions known at the point of registering? Best regards Tim Düsterhus Cheers Niels Best, Marc

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-13 Thread Marc Bennewitz
Hi Robert, On 13.10.23 13:44, Robert Landers wrote: On Fri, Oct 13, 2023 at 1:26 PM Jakub Zelenka wrote: On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I would personally pre

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-13 Thread Marc Bennewitz
Hi Jakub, On 13.10.23 13:25, Jakub Zelenka wrote: On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I would personally prefer a new function for rounding integers if anyone wan

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-06 Thread Marc Bennewitz
Hi Tim, On 05.10.23 21:57, Tim Düsterhus wrote: Hi On 10/4/23 08:35, Marc Bennewitz wrote: As far as I understand you are in favor of option 1. (considering it a bugfix) but how do you make sure this will not lead to different application behavior overlooked on upgrading? Also there is no way

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-06 Thread Marc Bennewitz
Hi George, On 05.10.23 14:12, G. P. B. wrote: On Thu, 5 Oct 2023 at 07:40, Marc Bennewitz wrote: I don't see a bug or broken behavior here as these functions were processing floating point numbers since forever. https://3v4l.org/PrrmO That's not my point, the point is

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-04 Thread Marc Bennewitz
On 05.10.23 01:38, G. P. B. wrote: On Tue, 26 Sept 2023 at 11:39, Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I don't understand the point of the deprecation phase at all. Frankly, I consider this RFC

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-03 Thread Marc Bennewitz
Hi, On 03.10.23 14:41, Tim Düsterhus wrote: Hi On 9/30/23 08:26, Marc Bennewitz wrote: The deprecation would act as an information for upcoming behavior change, not classical deprecation of future removal. If the new behavior is what you want, than you don't need to change anything

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-03 Thread Marc
om 2013 : https://wiki.php.net/rfc/gmp_number (never put to vote). Also I think to remember about a proposal to have GMP natively supported for numbers in PHP but I can't find it anymore. Kind regards, Jorg Best, Marc

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-03 Thread Marc
Hi, On 26.09.23 12:39, Marc Bennewitz wrote: I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I tried to make the RFC text a bit more clear. As I'm not a native English speaker I would be very welcome for wording suggestions and/or gra

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-29 Thread Marc Bennewitz
Hi Tim, On 29.09.23 17:28, Tim Düsterhus wrote: Hi On 9/26/23 12:39, Marc Bennewitz wrote: I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I find the proposal reasonable, but I don't like the deprecation proposal, because it does not allow

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Marc Bennewitz
rom the content of the passed source but what happens is the source does not contain any information about the encoding?. E.g. you load an XML/HTML document over HTTP, the encoding is defined via HTTP header but the content itself doesn't contain it. Kind regard

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-29 Thread Marc Bennewitz
Hi Saki, On 27.09.23 02:18, Saki Takamachi wrote: Hi, Marc. There is one additional case to consider. It's backwards compatible. If `strict_types` is not `1`, the code currently out there may be passing `int` to these functions. Therefore, it is better to be aware that such code can

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-26 Thread Marc Bennewitz
Hi Larry, On 26.09.23 20:41, Larry Garfield wrote: On Tue, Sep 26, 2023, at 10:39 AM, Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding Best, Marc I'm honestly kind of confused by this. The basic con

[PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-26 Thread Marc Bennewitz
Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding Best, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

[PHP-DEV] Wiki account for RFC

2023-09-23 Thread Marc
ndpwd Please could you help me what I have to do to back login. Thanks, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: Default values for php.ini environment variables

2023-07-13 Thread Marc
ether? Anyway even without ":+" or chaining it would be a very good addition :+1: Thanks, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

[PHP-DEV] number_format integer + overflow

2023-07-09 Thread Marc
Hi internals, As commented in thread of "rounding integers" [1], I have opened a PR [2] for fully supporting formatting integers using "number_format" without any precision loss. Additionally, on working on it, I noticed a possible integer overflow on |$decimals |argument of the current func

Re: [PHP-DEV] Base_convert changes

2023-06-30 Thread Marc
Hi, I noticed a deprecation of passing invalid characters to bindec since PHP 7.4 which is still deprecated and does not result in an error. Haven't checked the other affected functions of this RFC. https://3v4l.org/Bqj5B Is anyone taking care to remove this in 9.0? Thanks, Marc -

Re: [PHP-DEV] rounding integers

2023-06-28 Thread Marc
after rounding. Thanks, Marc [1] https://github.com/php/php-src/compare/master...marc-mabe:php-src:integer_rounding

[PHP-DEV] number_format() Support rounding negative places

2023-06-23 Thread Marc Bennewitz
if there are no objections, Ilija has agreed to merge this for master. We will of course document this accordingly. Thanks, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: [PHP-DEV] [RFC] [VOTE] Define proper semantics for range() function

2023-06-08 Thread Marc
On 08.06.23 13:16, G. P. B. wrote: On Thu, 8 Jun 2023 at 07:35, Marc wrote: sorry for speaking up so late but I think the following change is a mistake and unexpected: > Calls to range() that have integer boundaries but a float step that is compatible as an integer will now return

Re: [PHP-DEV] [RFC] [VOTE] Define proper semantics for range() function

2023-06-07 Thread Marc
value of the step. range(1, 5, 2.0) // list range(1, 5, 2.1) // list In my opinion, no matter, if start, end or step is a float the result should be a list. Thanks, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] rounding integers

2023-05-22 Thread Marc Bennewitz
On 21.05.23 17:20, Larry Garfield wrote: On Sun, May 21, 2023, at 7:18 AM, Rowan Tommins wrote: On 21 May 2023 13:00:30 BST, Dan Ackroyd wrote: On Sun, 21 May 2023 at 06:16, Marc wrote: Do you think this could be an acceptable BC-break No. Suggesting changing a 30 year old maths

[PHP-DEV] rounding integers

2023-05-20 Thread Marc
the given type and proper handle integers as well: > round — Rounds a number /** @template T of int|float */ round(T $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): T Do you think this could be an acceptable BC-break or should this be a different function? Thanks, Marc

Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions

2022-06-27 Thread Marc Bennewitz
as constant value as well. enum IdPrefix:string { case USER_ID = 'u-'; // ... } class UserId extends AbstractPrefixedUid { public const PREFIX = IdPrefix::USER_ID->value; } Greetings, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [Under Discussion] PDO driver specific sub-classes

2022-06-26 Thread Marc Bennewitz
but as we already have `quote` it would be preferable to name it `quoteIdentifier` or how would you explain the difference between `quote` and `escapeIdentifier`? Thanks Marc cheers Dan Ack

Re: [PHP-DEV] Alias stdClass to DynamicObject?

2021-09-07 Thread Marc Bennewitz
s there is no type for it and the issue of converting an empty array from/to JSON (is it a list or a map?). The big difference, of course, is the by-ref vs. by-value. Hope that's not stupid questions? Greetings, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Random Extension 3.0

2021-09-04 Thread Marc
ry to me to pass min/max arguments if you are just interested in a random integer or passing max as well if you are interested in a positive integer only. Thanks for the nice RFC! Regards, Go Kudo Marc

Re: [PHP-DEV] readonly properties

2021-08-13 Thread Marc
On 8/13/21 4:56 PM, Nikita Popov wrote: On Thu, Aug 12, 2021 at 9:16 PM Marc wrote: Hi, As 8.1 adds readonly properties I wonder which build-in properties should be defined readonly. Currently I could find build-in readonly properties only on PDO and DOM. Very incomplete list where

[PHP-DEV] readonly properties

2021-08-12 Thread Marc
2; var_dump($interval->days);  // 0 3. Exception properties Exception properties are protected but does it really make sense to be able to modify an exception property after initialization? I know this would be a BC break :( Thanks for all the excellent work - Can't wait for 8.1

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

2021-07-30 Thread Marc Bennewitz
lizable nor do we have generics to define an enum set of a specific type (ala EnumSet). Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: [RFC] is_literal

2021-06-18 Thread Marc Bennewitz
On 18.06.21 08:00, Craig Francis wrote: On Wed, 16 Jun 2021 at 18:24, Craig Francis wrote: On Sat, 12 Jun 2021 at 18:00, Craig Francis wrote: I'd like to start the discussion on the is_literal() RFC: https://wiki.php.net/rfc/is_literal Following up on the is_literal() RFC, thanks for th

Re: [PHP-DEV] Inconsistency in enumerations RFC

2021-03-17 Thread Marc
On 17.03.21 09:36, Ilija Tovilo wrote: Hi Marc I think it would be much clearer if there would be two different interfaces like: ``` interface IntEnum extends UnitEnum { public int $value; public static function from(int$value): static; public static function tryFrom(int$value): ?static

Re: [PHP-DEV] Inconsistency in enumerations RFC

2021-03-15 Thread Marc
Hi Ilija - thanks for your answers On 14.03.21 23:18, Ilija Tovilo wrote: Hi Marc Thanks for testing the enum feature. Hi I'm trying out the new enumeration support for PHP 8.1 using https://github.com/php/php-src/pull/6489 thought to implement a polyfill based on class constant

Re: [PHP-DEV] Built-in decorator attribute?

2021-03-14 Thread Marc
s, Wordpress and so on) makes this a potential future with wide adoption. If you'd get 2/3 votes for it is another topic. I can fully agree here - this would be very useful and I also thought in trying out something similar to wrap expensive functions by a cache but I don't have e

[PHP-DEV] Inconsistency in enumerations RFC

2021-03-14 Thread Marc
ching the string representation instead of TypeError as it matches the defined argument types. Thoughts? Thanks, Marc

Re: [PHP-DEV] Re: [RFC] Object-scope RNG implementation

2021-01-19 Thread Marc Bennewitz
m instead of two next/64 methods or limiting it? Like: * class MT19937(system depending) * class MT19937_32 (32bit version) * class MT19937_64 (64bit version - not available on 32bit) This way the user can take the algorithm that matches best his requirements. Marc Regards, Nikita -- PH

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-03 Thread Marc
Hi Ilija, On 03.01.21 12:54, Ilija Tovilo wrote: Hi Marc I don't have a really good use-case for float values. It just seems weird to me that a ScalarEnum doesn't support all scalars. Using the enum value as array key for `cases()` works with your current proposal but if we lat

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-03 Thread Marc
On 03.01.21 11:56, Marc wrote: > On 29.12.20 16:42, Larry Garfield wrote: >> On Tue, Dec 29, 2020, at 2:48 AM, Marc wrote: >>> On 28.12.20 21:21, Larry Garfield wrote: >>>> Hello, Internalians! >>>> >>>> After considerable discussion and effor

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-03 Thread Marc
On 29.12.20 16:42, Larry Garfield wrote: > On Tue, Dec 29, 2020, at 2:48 AM, Marc wrote: >> On 28.12.20 21:21, Larry Garfield wrote: >>> Hello, Internalians! >>> >>> After considerable discussion and effort, Ilija and I are ready to offer >>> you ro

Re: [PHP-DEV] Re: Improving PRNG implementation.

2021-01-03 Thread Marc
On 01.01.21 20:22, Go Kudo wrote: > Hi Marc, and sorry for the late reply. Email has been marked as spam... > >> I would expect the Random number generator to implement from Iterator > using an integer for current() value >> and providing utility functions (simple functions

Re: [PHP-DEV] Re: Improving PRNG implementation.

2020-12-29 Thread Marc
Hi zeriyoshi, On 23.12.20 14:41, zeriyoshi wrote: > Thanks tyson. > >> This would also make it easier to use those generators in brand new > algorithms that weren't in the initial RFC. >> (or in algorithms written by users in PHP) > This suggestion seems to make sense. Maybe the RNG should only fo

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2020-12-29 Thread Marc
On 28.12.20 21:21, Larry Garfield wrote: > Hello, Internalians! > > After considerable discussion and effort, Ilija and I are ready to offer you > round 2 on enumerations. This is in the spirit of the previous discussion, > but based on that discussion a great deal has been reworked. The main

Re: [PHP-DEV] Analysis of property visibility, immutability, and cloning proposals

2020-12-29 Thread Marc
On 28.12.20 21:23, Larry Garfield wrote: > There's been a number of discussions of late around property visibility and > how to make objects more immutable. Since it seems to have been > well-received in the past, I decided to do a complete analysis and context of > the various things that ha

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Marc Bennewitz
Am 05.12.20, 16:21 schrieb "Rowan Tommins" : (Apologies if this posts twice, I may have accidentally hit send before I'd finished writing it) On 05/12/2020 14:21, Marc Bennewitz wrote: > * Do cases have a stable ordinal number / position and

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Marc Bennewitz
Am 05.12.20, 16:08 schrieb "Larry Garfield" : On Sat, Dec 5, 2020, at 8:21 AM, Marc Bennewitz wrote: > > * How can you access a defined case value? > Something like `Suit::Spades->value()` At the moment it's only accessible via the :

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Marc Bennewitz
eof Enum` This basically means that all enumerations would to based on a general enum. This would be very helpful on providing functionalities especially for enumerations thinking about a doctrine enumeration type or again an EnumSet / EnumMap. Thanks Marc [1] https://github.com/marc-mabe/

Re: [PHP-DEV] Bug Wrong resolution of "Late Static Binding" after self::method()

2020-03-09 Thread Marc
Thank you all for explaining. This helps a lot! Marc On 09.03.20 10:27, Rowan Tommins wrote: On Mon, 9 Mar 2020 at 05:38, Marc wrote: Does it make sense? -> I have read "self::" all time as a shortcut for "MyClass::" until I noticed this is not the case and I exp

Re: [PHP-DEV] Bug Wrong resolution of "Late Static Binding" after self::method()

2020-03-08 Thread Marc
uot;static" reference? Sorry for all these questions. Sometimes the world could be so simple until it turns out it isn't for no reason. Thanks, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Bug Wrong resolution of "Late Static Binding" after self::method()

2020-03-08 Thread Marc
me why the result of "self::method()" is different then "$self = self::class; $self::method();". Thanks, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Strict operators directive

2019-07-10 Thread Marc
use these for bitsets. But I have a note here that bit shifting currently does not work with binary strings (tries to cast binary string to integer) and even if it would shift the binary string the >> is designed to keep the first bit as a positive/negative flag which of course does

Re: [PHP-DEV] Re: [RFC] New custom object serialization mechanism

2019-03-04 Thread Marc
On 04.03.19 10:08, Nikita Popov wrote: On Mon, Mar 4, 2019 at 6:31 AM Marc wrote: (sorry for top posting) Hi Nikita, as for the question about magic methods vs. interface. I have the feeling that it could be done with both in a clean way to make both parties happy. 1. Having

Re: [PHP-DEV] Re: [RFC] New custom object serialization mechanism

2019-03-03 Thread Marc
a solution for this as I have a library which would benefit from it: (https://github.com/marc-mabe/php-enum/blob/v3.1.1/src/EnumSerializableTrait.php#L46-L72) Would it be possible to instead get the new instance as argument and expect the instance to be returned but on the same time allow to

Re: [PHP-DEV] [RFC][Under Discussion] Add functions array_key_first()and array_key_last()

2018-06-26 Thread Marc Bennewitz
y_[key|value]_[first|last]($array)" is in my opinion not a good option as it lacks the possibility to extract key/value from any position. Something like "array_[key|value]_index($array, $index)" where $index would be the index position or negative index position from right. T

Re: [PHP-DEV] PHP_OS_FAMILY and macOS

2017-06-13 Thread Marc Bennewitz
Am 13.06.2017 um 21:35 schrieb Davey Shafik: Given that iPad (and iPhone) both run iOS which is based on Darwin, and Apple just relaxed the rules on running interpreted code, and we are already seeing IDEs spring up for the device, we should use "Darwin", rather than "Mac". This also encompasse

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Marc Bennewitz
rr); // no change var_dump((stdClass)$arr); // object of class stdClass var_dump((Foo)$arr); // object of class Foo Thoughts? Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: [RFC][Discuss] Arrow Functions

2017-01-30 Thread Marc Bennewitz
rackets but using the function keyword: function($x => $arr[$x]) Thanks Marc Cheers Stephen -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   >