Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Tim Düsterhus
Hi On 1/19/23 18:43, Ilija Tovilo wrote: You're right, we'll try to improve the wording and provide a handful of examples. Essentially, $callingScope should contain the class name of the calling scope, so the place where the magic method was called. When the calling scope is not a class (global

Re: [PHP-DEV] [RFC] [Discussion] Readonly class amendments

2023-01-19 Thread Tim Düsterhus
Hi On 1/19/23 09:01, Máté Kocsis wrote: As discussion apparently stalled, and since we managed to update the RFC with the recently brought up arguments, we would like to start the vote soon, possibly early next week, unless someone finds a new topic to discuss. I'm confused by the linked PRs f

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Marco Pivetta
Hey Ilija! On Thu, 19 Jan 2023, 20:26 Ilija Tovilo, wrote: > However, as demonstrated by the 3v4l, it's not > exactly trivial. It also requires the full stack trace, as well as all > frame objects and arguments. That's not going to be great for > performance. So saying debug_backtrace() exists f

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Ilija Tovilo
Hi Aleksander >> https://wiki.php.net/rfc/pass_scope_to_magic_accessors > > Why not a new function, e.g. func_call_scope()? It could work > everywhere, not only in magic methods. > > I guess it would be tricky with calls to the parent magic method when > you need the "outer calling scope", but

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Marco Pivetta
Not just that, but `debug_backtrace()` already exists for that purpose. On Thu, 19 Jan 2023, 19:23 Aleksander Machniak, wrote: > On 19.01.2023 17:23, Nicolas Grekas wrote: > > Hi internals, > > > > Ilija and I would like to start a discussion about the following RFC: > > https://wiki.php.net/rfc

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Aleksander Machniak
On 19.01.2023 17:23, Nicolas Grekas wrote: Hi internals, Ilija and I would like to start a discussion about the following RFC: https://wiki.php.net/rfc/pass_scope_to_magic_accessors When using magic methods to access actual properties, respecting their declared visibility is often desired. Yet,

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Ilija Tovilo
Hi Tim >> Ilija and I would like to start a discussion about the following RFC: >> https://wiki.php.net/rfc/pass_scope_to_magic_accessors > > Unless I missed anything, the RFC does not explain how the values that > are passed into the second parameter will look like. What kinds of > strings

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Tim Düsterhus
Hi On 1/19/23 17:23, Nicolas Grekas wrote: Ilija and I would like to start a discussion about the following RFC: https://wiki.php.net/rfc/pass_scope_to_magic_accessors When using magic methods to access actual properties, respecting their declared visibility is often desired. Yet, accessing the

[PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-19 Thread Nicolas Grekas
Hi internals, Ilija and I would like to start a discussion about the following RFC: https://wiki.php.net/rfc/pass_scope_to_magic_accessors When using magic methods to access actual properties, respecting their declared visibility is often desired. Yet, accessing the calling scope to emulate the v

Re: [PHP-DEV] [RFC] [Discussion] Readonly class amendments

2023-01-19 Thread Claude Pache
> Le 19 janv. 2023 à 10:12, Claude Pache a écrit : > > > >> Le 19 janv. 2023 à 09:01, Máté Kocsis a écrit : >> >> Hi Everyone, >> >> As discussion apparently stalled, and since we managed to update the RFC >> with the recently brought up arguments, we would like to start the vote >> soon,

Re: [PHP-DEV] [RFC] Path to Saner Increment/Decrement operators

2023-01-19 Thread Christoph M. Becker
On 19.01.2023 at 01:23, Mark Baker wrote: > However, the ++ and -- are the "Increment" and "Decrement" operators, > not the Add1 and Subtract1 operators; while they behave in that way when > used with variables containing numeric values, they are special > operators and not simply a syntactic suga

[PHP-DEV] PHP 8.2.2RC1 available for testing

2023-01-19 Thread Sergey Panteleev
PHP 8.2.2RC1 has just been released and can be downloaded from: https://downloads.php.net/~sergey/ Or use the git tag: php-8.2.2RC1 Windows binaries are available at https://windows.php.net/qa#php-8.2 Please test it carefully, and report any bugs in the bug system: https://github.com/php/php-sr

Re: [PHP-DEV] Measuring Proposal Reaction

2023-01-19 Thread Christian Schneider
> Am 18.01.2023 um 23:29 schrieb Larry Garfield : > On Tue, Jan 17, 2023, at 1:25 PM, Jesse G. Donat wrote: >> I'm looking to measure reaction to a proposal. >> >> My proposal is to have the STDOUT and STDERR global constants always >> defined rather than just when running via CLI. > > Does any

Re: [PHP-DEV] RFC: rules for #include directives

2023-01-19 Thread Max Kellermann
On 2023/01/18 18:51, Kamil Tekiela wrote: > - I am against forward struct declarations. I think they decrease code > readability and should be avoided. btw. if this opinion is shared by the majority of voters, I'll send a PR to remove all existing forward declarations from PHP. There are many, f

Re: [PHP-DEV] RFC: rules for #include directives

2023-01-19 Thread Max Kellermann
On 2023/01/18 18:51, Kamil Tekiela wrote: > > #include "zend_portability.h" // for BEGIN_EXTERN_C > What if in future the need for BEGIN_EXTERN_C disappears? Who is going to > remember to update the comment? (I just addressed that concern in reply to Rowan's email.) > As you said yourself, this

Re: [PHP-DEV] RFC: rules for #include directives

2023-01-19 Thread Max Kellermann
On 2023/01/18 18:06, Rowan Tommins wrote: > Then I guess you've never heard people quoting Robert "Uncle Bob" Martin, who > is well known for asserting that code should be self-documenting, and > therefore not need comments, saying things like: > > > The proper use of comments is to compensate

Re: [PHP-DEV] [RFC] [Discussion] Readonly class amendments

2023-01-19 Thread Claude Pache
> Le 19 janv. 2023 à 09:01, Máté Kocsis a écrit : > > Hi Everyone, > > As discussion apparently stalled, and since we managed to update the RFC > with the recently brought up arguments, we would like to start the vote > soon, possibly early next week, unless someone finds a new topic to discu

Re: [PHP-DEV] [RFC] [Discussion] Readonly class amendments

2023-01-19 Thread Máté Kocsis
Hi Everyone, As discussion apparently stalled, and since we managed to update the RFC with the recently brought up arguments, we would like to start the vote soon, possibly early next week, unless someone finds a new topic to discuss. Máté Larry Garfield ezt írta (időpont: 2022. nov. 30., Sze,