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

2021-03-15 Thread Mike Schinkel
> On Mar 15, 2021, at 1:41 PM, Mark Randall wrote: > > Hi Internals, > > 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_classm

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

2021-03-15 Thread Katie Volz
I was able to get a proof of concept of the following at https://github.com/iggyvolz/hooks: On 3/14/2021 7:52 AM, Benjamin Eberlei wrote: However, as functionality it could be provided as an extension first for a proof of concept. The ingredients are all there, it doesn't need to be in core: 1

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

2021-03-15 Thread Max Semenik
On Tue, Mar 16, 2021 at 2:01 AM Christian Schneider wrote: > If the number of classes to load is indeed that big that the function call > overhead is significant enough (I agree with Levi that some numbers > illustrating what we're talking about would be nice), wouldn't that be a > case for class

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

2021-03-15 Thread Christian Schneider
Am 15.03.2021 um 18:41 schrieb Mark Randall : > 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 Just so I understand co

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

2021-03-15 Thread Levi Morrison via internals
On Mon, Mar 15, 2021 at 12:32 PM Mark Randall wrote: > > On 15/03/2021 17:59, Levi Morrison via internals wrote: > > IMO, these should be the defined case of the class, or we should be > > insensitive about it. It's one thing that our symbols are case > > insensitive; it is wholly another to _requ

Re: [PHP-DEV] [RFC] [Discussion] Adding return types to internal methods

2021-03-15 Thread Nicolas Grekas
Hi Máté, 1.) A few other people off-list also shared their negative feelings about > the E_STRICT. So I'm ok to use E_DEPRECATED instead. > Now that I implemented the suppressing mechanism, I think using a separate > error type is not needed anymore that much. > Wonderful! > 2.) Unifying the Te

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

2021-03-15 Thread Mark Randall
On 15/03/2021 17:59, Levi Morrison via internals wrote: IMO, these should be the defined case of the class, or we should be insensitive about it. It's one thing that our symbols are case insensitive; it is wholly another to _require_ it for this feature by requiring lowercase names. I assume ther

Re: [PHP-DEV] [RFC Proposal] Allow methods to 'become' static

2021-03-15 Thread Matthew Brown
On Mon, 15 Mar 2021 at 09:36, Nikita Popov wrote: > I'm not sure I follow your point. The fact that something is compatible, > does not mean that you can just blindly perform a forwarding call. For > example, consider this: > > class A { > public function method(string $x) {} > } > > class B

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

2021-03-15 Thread Levi Morrison via internals
On Mon, Mar 15, 2021 at 11:41 AM Mark Randall wrote: > > Hi Internals, > > 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

[PHP-DEV] [RFC] Autoloader Classmap

2021-03-15 Thread Mark Randall
Hi Internals, 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 Mark Randall marand...@php.net -- PHP Internals - PHP Runtime

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 and reflecti

Re: [PHP-DEV] PDO::PARAM_INT and pgsql driver

2021-03-15 Thread Matteo Beccati
Hi, On 14/03/2021 21:18, Benjamin Morel wrote: This is because the pgsql driver seems to treat everything as PARAM_STR, despite being explicitly requested to bind the value as PARAM_INT; the placeholder is therefore replaced with the string '4326' instead of the integer 4326. > [...] Is there a

Re: [PHP-DEV] [RFC] noreturn type

2021-03-15 Thread Nikita Popov
On Wed, Mar 10, 2021 at 7:07 PM Matthew Brown wrote: > Hey, > > Ondřej Mirtes and I present an RFC for the noreturn type: > https://wiki.php.net/rfc/noreturn_type > > The feature already exists in Hack (the primary inspiration) and is > currently supported by our static analysis tools inside docb

Re: [PHP-DEV] RFC: Add `println(string $data = ''): int`

2021-03-15 Thread Nikita Popov
On Mon, Mar 15, 2021 at 4:09 PM Nikita Popov wrote: > On Mon, Mar 15, 2021 at 4:08 AM Sara Golemon wrote: > >> On Sat, Mar 13, 2021 at 1:54 PM tyson andre >> wrote: >> >> > >> > I've created a new RFC https://wiki.php.net/rfc/println >> > This proposes adding a global function to PHP to >> > pr

Re: [PHP-DEV] RFC: Add `println(string $data = ''): int`

2021-03-15 Thread Nikita Popov
On Mon, Mar 15, 2021 at 4:08 AM Sara Golemon wrote: > On Sat, Mar 13, 2021 at 1:54 PM tyson andre > wrote: > > > > > I've created a new RFC https://wiki.php.net/rfc/println > > This proposes adding a global function to PHP to > > print a string followed by a unix newline (`\n`). > > > > > This i

Re: [PHP-DEV] Add support for ::class to constant()

2021-03-15 Thread Nikita Popov
On Tue, Mar 9, 2021 at 11:16 PM Kévin Dunglas wrote: > Hi folks, > > Currently, it's not possible to use the ::class special constant with the > constant() function. This doesn't work: > > var_dump( > constant('\DateTime::class') > ); > > For instance, Twig's constant() helper internally uses t

Re: [PHP-DEV] [RFC Proposal] Allow methods to 'become' static

2021-03-15 Thread Rowan Tommins
On 15/03/2021 13:16, Matthew Brown wrote: On Sun, 14 Mar 2021 at 18:09, Rowan Tommins > wrote: Are you saying that having the parent::getSomeInt() call fail would be problematic?  Yes, that's where this becomes unsound – you can call the child metho

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

2021-03-15 Thread David Gebler
> Would it make sense to have both options? If you have the wrapper pattern, you already have both options. This would be my preferred way of doing it but harder to implement, particularly in any way which significantly mimics Python's way of doing it. > One problem with the wrapper pattern is th

Re: [PHP-DEV] [RFC Proposal] Allow methods to 'become' static

2021-03-15 Thread Nikita Popov
On Mon, Mar 15, 2021 at 2:16 PM Matthew Brown wrote: > On Sun, 14 Mar 2021 at 18:09, Rowan Tommins > wrote: > > > Are you saying that having the parent::getSomeInt() call fail would be > > problematic? > > > > > Yes, that's where this becomes unsound – you can call the child method > statically

Re: [PHP-DEV] PDO::PARAM_INT and pgsql driver

2021-03-15 Thread Christoph M. Becker
On 15.03.2021 at 14:12, Matteo Beccati wrote: > On 14/03/2021 21:18, Benjamin Morel wrote: >> This is because the pgsql driver seems to treat everything as PARAM_STR, >> despite being explicitly requested to bind the value as PARAM_INT; the >> placeholder is therefore replaced with the string '432

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-15 Thread Moritz Friedrich
I would assume the moment I call some kind of ISO conversion or serialization method on a dynamic interval, I’d receive output relative to now. `createFromDateString` creates the interval relative to now, so why shouldn’t the reverse hold true? Regards, Moritz > Am 15.03.2021 um 10:18 schrieb

Re: [PHP-DEV] [RFC Proposal] Allow methods to 'become' static

2021-03-15 Thread Matthew Brown
On Sun, 14 Mar 2021 at 18:09, Rowan Tommins wrote: > Are you saying that having the parent::getSomeInt() call fail would be > problematic? > > Yes, that's where this becomes unsound – you can call the child method statically, but the parent call assumes a dynamic instance. This is just my persp

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-15 Thread Derick Rethans
On Wed, 3 Mar 2021, Moritz Friedrich wrote: > I would like to propose adding a `__toString()` method to the > `DateInterval` class that should return a valid ISO8601 interval > (https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). As it stands, > the class supports creating instances from su