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

2024-04-12 Thread Marc Bennewitz
= '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
." 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
ut 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
the type } 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
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-in to ne

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
. 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 public key

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

2024-02-23 Thread Marc Bennewitz
uct 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 (including PH

Re: [PHP-DEV] Requesting RFC karma

2024-02-20 Thread Marc Bennewitz
!` * 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 very small close to no BC improvements without RFC. Marc OpenPG

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 number

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 uses a double

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
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 that see

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

2023-10-19 Thread Marc Bennewitz
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
appen 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 prefer

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 wants

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 about

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

2023-10-05 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 a bug fix

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

2023-10-04 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
://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 grammar fixes

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

2023-09-30 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 me to opt

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

2023-09-29 Thread Marc Bennewitz
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 regards Niels Best, Marc

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 have

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 concept, as I

[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
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
nyway 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

Re: [PHP-DEV] Base_convert changes

2023-07-01 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 -- PHP

Re: [PHP-DEV] rounding integers

2023-06-28 Thread Marc
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 ret

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

2023-06-08 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
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
R_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-27 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
ssue 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
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 :) Marc -- PHP Internals - PHP Runtime Dev

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

2021-07-30 Thread Marc Bennewitz
ne 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

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 constants

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

2021-03-14 Thread Marc
'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 enough C skills and even less time for that. Thanks, Marc -- PHP Internals - PHP Runti

[PHP-DEV] Inconsistency in enumerations RFC

2021-03-14 Thread Marc
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
wo 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 -- PHP Internals - P

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 later want

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 ef

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

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

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

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 is th

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 ::c

Re: [PHP-DEV] [RFC] Enumerations

2020-12-05 Thread Marc Bennewitz
sically 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/php-enum -- L

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
" 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
es 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 not make sense for binary strings. In my opinion the bit shifting operators should accept and work well with binary

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
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 retur

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

2018-06-26 Thread Marc Bennewitz
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. Thanks, Marc Am

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

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

2017-03-14 Thread Marc Bennewitz
ump((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
ets 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

[PHP-DEV] Allow "static" type

2017-01-27 Thread Marc Bennewitz
ase::test($ext); Ext::test($ext); Ext::test($base); Thanks Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint, now with added variance

2016-11-23 Thread Marc Bennewitz
Am 23.11.2016 um 01:52 schrieb Dan Ackroyd: Hi, This is the reintroduction of the Object Type RFC for discussion. There was previously strong feedback from people who would prefer that the inheritance checks for methods that use object types should be co/contravariant. This has been added to

Re: [PHP-DEV] strtod and NaN vs. zero

2016-10-24 Thread Marc Bennewitz
Hi Andrea, Am 24.10.2016 um 15:40 schrieb Andrea Faulds: Hi, Marc Bennewitz wrote: But I'm still curious why casting any non numeric string results in the valid number float(0) where there is a special value in floating point numbers declared to represent not a number values. Because

Re: [PHP-DEV] strtod and NaN vs. zero

2016-10-23 Thread Marc Bennewitz
Am 23.10.2016 um 21:13 schrieb Marc Bennewitz: Am 23.10.2016 um 13:49 schrieb Niklas Keller: 2016-10-23 12:55 GMT+02:00 Marc Bennewitz <dev@mabe.berlin <mailto:dev@mabe.berlin>>: Hi internals, On casting a non numeric value to a float in PHP the result will be

Re: [PHP-DEV] strtod and NaN vs. zero

2016-10-23 Thread Marc Bennewitz
Am 23.10.2016 um 13:49 schrieb Niklas Keller: 2016-10-23 12:55 GMT+02:00 Marc Bennewitz <dev@mabe.berlin <mailto:dev@mabe.berlin>>: Hi internals, On casting a non numeric value to a float in PHP the result will be float(0). In PHP-7.0 an exception wa

[PHP-DEV] strtod and NaN vs. zero

2016-10-23 Thread Marc Bennewitz
all cases of casting a non numeric string to a floating point number? Thanks Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Class Constant Visibility BC Break

2016-08-21 Thread Marc Bennewitz
/marc-mabe/php-enum/blob/master/src/Enum.php#L295-L327 but this BC break happens to all using ReflectionClass::getConstants() for public constants only e.g. accessing values later with constant(). Cheers Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] Bug or expected behavior?

2016-05-31 Thread Marc Bennewitz
On 05/31/2016 09:59 PM, Nikita Popov wrote: On Tue, May 31, 2016 at 9:54 PM, Marc Bennewitz <dev@mabe.berlin <mailto:dev@mabe.berlin>> wrote: Hi, today I was running into an issue with a function lookup over namespace. https://3v4l.org/qF7cK fails https://3v

[PHP-DEV] Bug or expected behavior?

2016-05-31 Thread Marc Bennewitz
ion exists in the current namespace before looking in the root namespace. Because PHP is a dynamic language this behavior looks wrong (unexpected) to me and also HHVM does handle it as I would expect it. Thanks, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, v

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-24 Thread Marc Bennewitz
this for a long long time but without a lot of overplayed code for $this. Thanks, Marc Regadrds, -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Immutable modifier

2015-11-17 Thread Marc Bennewitz
FYI there was a very small discussion about it ~ 1 year ago https://www.mail-archive.com/internals@lists.php.net/msg71521.html On 11/16/2015 10:15 AM, Chris Riley wrote: Hi, There has been a lot of interest recently (eg psr-7) in immutable data. I'm considering putting an RFC together to add

Re: [PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-02 Thread Marc Bennewitz
ll) {} } class Bar extends Foo { public function test(Foo $foo = null, ...$bar) {} } Regards, Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Void Return Type (v0.2, reöpening)

2015-10-15 Thread Marc Bennewitz
sing return value of explicit return void function foo () : void { return; }; $bar = foo(); // return NULL on implicit return void (this could also give a warning/notice/deprecated error) function foo () { return; }; $bar = foo(); // NULL // mixing return void with any other return values could also result in a warning/notice/deprecated error function foo () { if ($bar) return; return $bar; }; --Larry Garfield > I really like this as in my opinion if a function doesn't return something it should be part of the function signature and it really helps to avoid mistakes on writing code. Marc

Re: [PHP-DEV] Re: [RFC] [Concept] Class Constant visibility modifiers in PHP 7.1+

2015-09-07 Thread Marc Bennewitz
it in! I really like this feature but please make sure it doesn't break BC on usage of Reflection::getConstant(s). For example I'm using this for an implementation of constant based enumerations: (https://github.com/marc-mabe/php-enum/blob/master/src/Enum.php#L277) Marc -- PHP Internals - PHP

Re: [PHP-DEV] Headsup: PHP7 feature freeze

2015-06-28 Thread Marc Bennewitz
On 06/28/2015 09:22 PM, Christoph Becker wrote: Marc Bennewitz wrote: On 06/25/2015 09:48 PM, Aaron Piotrowski wrote: On Jun 25, 2015, at 2:39 PM, Marc Bennewitz dev@mabe.berlin mailto:dev@mabe.berlin wrote: Nice to see this - didn't noted it in the last month :) But there is one edge

Re: [PHP-DEV] Headsup: PHP7 feature freeze

2015-06-28 Thread Marc Bennewitz
On 06/25/2015 09:48 PM, Aaron Piotrowski wrote: On Jun 25, 2015, at 2:39 PM, Marc Bennewitz dev@mabe.berlin mailto:dev@mabe.berlin wrote: Nice to see this - didn't noted it in the last month :) But there is one edge case that is not handled by PHP-7 at current behavior; http://3v4l.org

Re: [PHP-DEV] Headsup: PHP7 feature freeze

2015-06-25 Thread Marc Bennewitz
On 06/25/2015 09:31 PM, Christoph Becker wrote: Marc Bennewitz wrote: I would really like to see directly calling a string of Class::method be fixed for 7.0. It's currently resulting in a fatal error and is inconsistent with call_user_func[_array], is_callable and the callable type-hint

Re: [PHP-DEV] Headsup: PHP7 feature freeze

2015-06-25 Thread Marc Bennewitz
On 06/25/2015 09:39 PM, Marc Bennewitz wrote: On 06/25/2015 09:31 PM, Christoph Becker wrote: Marc Bennewitz wrote: I would really like to see directly calling a string of Class::method be fixed for 7.0. It's currently resulting in a fatal error and is inconsistent with call_user_func

Re: [PHP-DEV] Headsup: PHP7 feature freeze

2015-06-25 Thread Marc Bennewitz
On 06/25/2015 05:03 PM, Kalle Sommer Nielsen wrote: Howdy This is a quick heads up that we plan to have the next release of 7.0.0 be Beta 1, this marks a feature freeze and from there on, we will switch focus on to stabilization, regressions and other bug fixes. Beta 1 is schedule to be

Re: [PHP-DEV] Migrating PHP classes to built in namespace

2015-06-04 Thread Marc Bennewitz
On 06/04/2015 10:01 AM, Yasuo Ohgaki wrote: Hi all, On Thu, Jun 4, 2015 at 12:07 AM, Sara Golemon poll...@php.net wrote: On Wed, Jun 3, 2015 at 1:33 AM, Dominic Grostate codekest...@googlemail.com wrote: Has there been any discussion or consideration towards migrating or at least aliasing

  1   2   3   >