Re: [PHP-DEV] [RFC] Autoloader Classmap

2021-04-05 Thread Stephen Reay
> On 6 Apr 2021, at 05:05, Mark Randall wrote: > > On 15/03/2021 17:41, Mark Randall wrote: >> I would like to propose the addition of a new mechanism of autoloading >> classes - a classmap that will be consulted prior to checking the >> spl_autoload_register'd callbacks. >>

Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Marco Pivetta
Hey Jesse, On Tue, Apr 6, 2021, 03:00 Jesse Rushlow wrote: > Sure thing - > > In Symfony's MakeBundle we have a command "php bin/console make:command". > This ultimately generates a "App\Console\XyzUserlandCommand::class" that > allows the developer to customize in order to perform some task

Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Jesse Rushlow
Sure thing - In Symfony's MakeBundle we have a command "php bin/console make:command". This ultimately generates a "App\Console\XyzUserlandCommand::class" that allows the developer to customize in order to perform some task within their app. e.g. run persistence operations, generate a backup,

[PHP-DEV] Re: [RFC] Autoloader Classmap

2021-04-05 Thread Mark Randall
On 15/03/2021 17:41, Mark Randall wrote: I would like to propose the addition of a new mechanism of autoloading classes - a classmap that will be consulted prior to checking the spl_autoload_register'd callbacks. https://wiki.php.net/rfc/autoload_classmap Does anyone else have any more

[PHP-DEV] [8.1] Release Manager Election

2021-04-05 Thread Sara Golemon
Happy Monday, everyone (unless it's Tuesday, in which case: Happy Tuesday!); We've had an INCREDIBLE turn-out for PHP 8.1 Release Manager selection this year. In the role of "Veteran" release manager, Joe Watkins[0] has kindly stepped up and offered to mentor two rookies, so there will be two

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Marco Pivetta
On Mon, Apr 5, 2021, 22:51 Marco Pivetta wrote: > > > On Mon, Apr 5, 2021, 19:42 Mike Schinkel wrote: > >> >> > On Apr 5, 2021, at 12:47 PM, Ben Ramsey wrote: >> > >> >> On Apr 5, 2021, at 11:40, André Hänsel wrote: >> >> >> >> I was wondering... PHP is the only language I know of where you

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Marco Pivetta
On Mon, Apr 5, 2021, 19:42 Mike Schinkel wrote: > > > On Apr 5, 2021, at 12:47 PM, Ben Ramsey wrote: > > > >> On Apr 5, 2021, at 11:40, André Hänsel wrote: > >> > >> I was wondering... PHP is the only language I know of where you have to > >> write `(new Foo())->bar()` instead of > >> `new

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Christoph M. Becker
On 05.04.2021 at 19:19, Ben Ramsey wrote: >> On Apr 5, 2021, at 12:12, Christoph M. Becker wrote: >> >> On 05.04.2021 at 18:40, André Hänsel wrote: >> >>> I was wondering... PHP is the only language I know of where you have to >>> write `(new Foo())->bar()` instead of >>> `new Foo()->bar()`.

RE: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread André Hänsel
Rowan Tommins wrote: > it was looking for a property $bar, not a method bar(). Working version: > https://3v4l.org/S9gLf Oh, right. > we would need to allow a more restricted version, as discussed on that > feature request. Yeah, that would be great. I think it would already cover the by far

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Stanislav Malyshev
Hi! On 4/5/21 9:40 AM, André Hänsel wrote: I was wondering... PHP is the only language I know of where you have to write `(new Foo())->bar()` instead of `new Foo()->bar()`. This is particularly apparent with the builder pattern: Enabling something that is syntax error now sounds pretty

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Rowan Tommins
On 05/04/2021 20:51, André Hänsel wrote: Note that in that bug entry the solution was based on the premise that `$obj = new $foo->bar();` was valid code, which it isn't. (https://3v4l.org/lpN1T) Looking at the error message, that code parsed as valid, but failed at run-time, because it was

RE: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread André Hänsel
Mike Schinkel wrote: > I had asked Ben what he thought about allowing the following syntax as a > synonym for `new Foo()`: > > Foo::new() This can already be done in application code, having the language add a synonym is IMO unnecessary magic and breaks the principle of the least surprise.

Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Rowan Tommins
On 05/04/2021 18:14, Jesse Rushlow wrote: I was attempting to use class_exists(UsesPropertyPromotion::class) to determine if an attribute implementation existed in order to generate a PHP 8 appropriate class - else fall back to generating a PHP 7 appropriate class. For context, this check was

[PHP-DEV] Re: RFC: PDO MySQL get warning count

2021-04-05 Thread Daniel Beardsley
This RFC is considering adding a very tiny function wrapping a mysql function that hasn't changed in decades. This allows clients to see if their previous statement generated mysql warnings without having to do another network round trip to the DB. I've opened the pull with tests. It fixes the

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Mike Schinkel
> On Apr 5, 2021, at 1:51 PM, Claude Pache wrote: > >> Le 5 avr. 2021 à 19:42, Mike Schinkel a écrit : >> >> Foo::new() >> >> That would be backward compatible because you currently cannot have a method >> named `new()`. > > Really? The following compiles without hiccup for me:

Re: [PHP-DEV] [RFC] Namespaced in bundled extensions

2021-04-05 Thread tyson andre
> > The question of namespaces in the stdlib has been coming up a lot recently, > > so I'd like to present my own stab at resolving this question: > > > > https://wiki.php.net/rfc/namespaces_in_bundled_extensions > > > > Relative to a number of previous (declined) proposals, the main difference >

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Claude Pache
> Le 5 avr. 2021 à 19:42, Mike Schinkel a écrit : > > Foo::new() > > That would be backward compatible because you currently cannot have a method > named `new()`. Really? The following compiles without hiccup for me: https://3v4l.org/Vb5Sj —Claude

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Mike Schinkel
> On Apr 5, 2021, at 12:47 PM, Ben Ramsey wrote: > >> On Apr 5, 2021, at 11:40, André Hänsel wrote: >> >> I was wondering... PHP is the only language I know of where you have to >> write `(new Foo())->bar()` instead of >> `new Foo()->bar()`. This is particularly apparent with the builder

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Ben Ramsey
> On Apr 5, 2021, at 12:12, Christoph M. Becker wrote: > > On 05.04.2021 at 18:40, André Hänsel wrote: > >> I was wondering... PHP is the only language I know of where you have to >> write `(new Foo())->bar()` instead of >> `new Foo()->bar()`. This is particularly apparent with the builder

[PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Jesse Rushlow
Howdy Internals, I discovered today (purely on accident) that class_exists($subject) actually parses the "$subect" class in question. I was attempting to use class_exists(UsesPropertyPromotion::class) to determine if an attribute implementation existed in order to generate a PHP 8 appropriate

[PHP-DEV] Re: Raising the precedence of the new operator

2021-04-05 Thread Christoph M. Becker
On 05.04.2021 at 18:40, André Hänsel wrote: > I was wondering... PHP is the only language I know of where you have to > write `(new Foo())->bar()` instead of > `new Foo()->bar()`. This is particularly apparent with the builder pattern: > > $developer->drink((new

Re: [PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread Ben Ramsey
> On Apr 5, 2021, at 11:40, André Hänsel wrote: > > I was wondering... PHP is the only language I know of where you have to > write `(new Foo())->bar()` instead of > `new Foo()->bar()`. This is particularly apparent with the builder pattern: > > $developer->drink((new

[PHP-DEV] Raising the precedence of the new operator

2021-04-05 Thread André Hänsel
I was wondering... PHP is the only language I know of where you have to write `(new Foo())->bar()` instead of `new Foo()->bar()`. This is particularly apparent with the builder pattern: $developer->drink((new Coffee())->withCream()->withSugar()); $logger->log((new

Re: [PHP-DEV] [VOTE] Direct execution opcode file without php source code file

2021-04-05 Thread Aleksander Machniak
On 05.04.2021 04:11, €– ”k”k wrote: > https://wiki.php.net/rfc/direct-execution-opcode I voted No because I can't imagine anyone voting Yes to a RFC as badly written as this one. -- Aleksander Machniak Kolab Groupware Developer[https://kolab.org] Roundcube Webmail Developer

RE: [PHP-DEV] [VOTE] Direct execution opcode file without php source code file

2021-04-05 Thread CHU Zhaowei
Voted no as well. As point out during discussion, we are still not clear about the advantages of this proposal. There are other competitive, if not better, alternatives for the scenarios that the author suggested. Regards, CHU Zhaowei > -Original Message- > From: ��C ”k”k > Sent: