Re: [PHP-DEV] Inline conditional that returns null if falsy

2021-02-25 Thread Larry Garfield
On Thu, Feb 25, 2021, at 2:55 AM, Rowan Tommins wrote: > On 24/02/2021 04:26, Mike Schinkel wrote: > > Repeating code similar to that from the message sent by David Rodrigues you > > can see that eliminating the ": null" is less noisy: > > > > ... > > ... > > > That's an interesting us

Re: [PHP-DEV] [RFC] class_name:namespace

2021-02-25 Thread Manuel Canga
-- Manuel Canga Zend Certified PHP Engineer Websites: https://manuelcanga.dev | https://trasweb.net Linkedin: https://es.linkedin.com/in/manuelcanga En jue, 25 feb 2021 23:12:23 +0100 David Gebler escribió > You can achieve what you're trying to do already with a combination of

Re: [PHP-DEV] [RFC] class_name:namespace

2021-02-25 Thread David Gebler
You can achieve what you're trying to do already with a combination of get_class() on a namespaced class and a simple regex (or other method of processing a string to your liking): $foo = "My\\Namespace\\Name\\Class"; var_dump(preg_match('/^(.*)\\\([^\\\]*)$/m',$foo,$matches),$matches); array(3)

Re: [PHP-DEV] [RFC] class_name:namespace

2021-02-25 Thread Manuel Canga
En jue, 25 feb 2021 21:41:40 +0100 Nikita Popov escribió > On Thu, Feb 25, 2021 at 8:11 PM Manuel Canga wrote: > > > Hi internals, > > > > I would like to present a possible new RFC( "class_name:namespace" ) for > > your consideration. > > > > As you know, namespaces are very

Re: [PHP-DEV] [RFC] Static variables in inherited methods

2021-02-25 Thread Glash Gnome
I can understand that some people coming from C++, Java may be shocked by the behavior of a static variable in a static function. And the need to improve things. Maybe can you add *virtual static* keywords as a replacement for old behavior in your RFC

Re: [PHP-DEV] [RFC] class_name:namespace

2021-02-25 Thread Nikita Popov
On Thu, Feb 25, 2021 at 8:11 PM Manuel Canga wrote: > Hi internals, > > I would like to present a possible new RFC( "class_name:namespace" ) for > your consideration. > > As you know, namespaces are very important nowdays. They are used in > autoloaders, Frameworks, CMS, ... > > Maybe, you are us

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

2021-02-25 Thread Nikita Popov
Hi internals, 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 is that I

[PHP-DEV] [RFC] class_name:namespace

2021-02-25 Thread Manuel Canga
Hi internals, I would like to present a possible new RFC( "class_name:namespace" ) for your consideration. As you know, namespaces are very important nowdays. They are used in autoloaders, Frameworks, CMS, ... Maybe, you are used to code something similar to this: ``` use MyProject\MyHelpers

Re: [PHP-DEV] [RFC] Static variables in inherited methods

2021-02-25 Thread Nikita Popov
On Thu, Feb 25, 2021 at 4:46 PM Glash Gnome wrote: > Dears, > > Let me briefly introduce myself. I have been a C coder for 19 years, > including 12 years with php. And I also do Java, C++, Javascript... from > time to time. > > Nikita, What would the equivalent of this code be after RFC modificat

Re: [PHP-DEV] [RFC] Static variables in inherited methods

2021-02-25 Thread Glash Gnome
Dears, Let me briefly introduce myself. I have been a C coder for 19 years, including 12 years with php. And I also do Java, C++, Javascript... from time to time. Nikita, What would the equivalent of this code be after RFC modification? a écrit : > Hi internals, > > While looking into various

Re: [PHP-DEV] [VOTE] fsync function

2021-02-25 Thread David Gebler
Thanks Marco, objection understood. I think Nikita's already said what I would say, from my view I can only reiterate I felt it was more appropriate to keep the behaviour consistent with how similar stream ops work. Regards David Gebler On Thu, 25 Feb 2021, 13:38 Marco Pivetta, wrote: > Het Nik

Re: [PHP-DEV] [VOTE] fsync function

2021-02-25 Thread Marco Pivetta
Het Nikita, On Thu, Feb 25, 2021 at 1:04 PM Nikita Popov wrote: > > Throwing a warning in such a case is consistent with how functions for > other optional stream operations work. > I understand that, and I'm OK with being **against** it. Marco Pivetta http://twitter.com/Ocramius http://ocra

Re: [PHP-DEV] RFC: Error backtraces

2021-02-25 Thread Nikita Popov
On Wed, Jun 3, 2020 at 9:04 AM Nikita Popov wrote: > On Tue, Jun 2, 2020 at 10:57 PM Max Semenik wrote: > >> On Sun, May 31, 2020 at 4:47 PM Nikita Popov >> wrote: >> >> > I'm concerned about the performance implications of this change. >> Backtrace >> > gathering is quite expensive and doing t

[PHP-DEV] timelib inefficiency

2021-02-25 Thread Dmitry Stogov
Hi Derick, Please take a look https://github.com/php/php-src/blob/51914610ab8bf75d87e5cdec15bd1b38de7907c5/ext/date/lib/parse_date.re#L684-L700 This code is enormously inefficient. For a single abbr_search(), it calls timelib_strcasecmp() more than 1000 times (complete linear search in a huge al

Re: [PHP-DEV] [VOTE] fsync function

2021-02-25 Thread Christoph M. Becker
On 25.02.2021 at 13:03, Nikita Popov wrote: > On Thu, Feb 25, 2021 at 1:01 PM Christoph M. Becker > wrote: > >> On 25.02.2021 at 12:43, Marco Pivetta wrote: >>> Hey David, >>> >>> >>> >>> On Wed, Feb 24, 2021 at 6:15 PM David Gebler >> wrote: >>> Voting is now

Re: [PHP-DEV] [VOTE] fsync function

2021-02-25 Thread Nikita Popov
On Thu, Feb 25, 2021 at 1:01 PM Christoph M. Becker wrote: > On 25.02.2021 at 12:43, Marco Pivetta wrote: > > Hey David, > > > > > > > > On Wed, Feb 24, 2021 at 6:15 PM David Gebler > wrote: > > > >> Voting is now open for 2 weeks on > https://wiki.php.net/rfc/fsync

Re: [PHP-DEV] [VOTE] fsync function

2021-02-25 Thread Christoph M. Becker
On 25.02.2021 at 12:43, Marco Pivetta wrote: > Hey David, > > > > On Wed, Feb 24, 2021 at 6:15 PM David Gebler wrote: > >> Voting is now open for 2 weeks on https://wiki.php.net/rfc/fsync_function >> >> Regards, >> David Gebler >> >> On Tue, Feb 23, 2021 at 5:15 PM Da

Re: [PHP-DEV] [VOTE] fsync function

2021-02-25 Thread Marco Pivetta
Hey David, On Wed, Feb 24, 2021 at 6:15 PM David Gebler wrote: > Voting is now open for 2 weeks on https://wiki.php.net/rfc/fsync_function > > Regards, > David Gebler > > On Tue, Feb 23, 2021 at 5:15 PM David Gebler > wrote: > > > Hi internals, > > As there appear

Re: [PHP-DEV] Inline conditional that returns null if falsy

2021-02-25 Thread Kingsquare.nl - Robin Speekenbrink
Op do 25 feb. 2021 om 09:55 schreef Rowan Tommins : > On 24/02/2021 04:26, Mike Schinkel wrote: > > Repeating code similar to that from the message sent by David Rodrigues > you can see that eliminating the ": null" is less noisy: > > > > ... > > ... > > Also just to have a somewhat appl

Re: [PHP-DEV] [RFC] Static variables in inherited methods

2021-02-25 Thread Nikita Popov
On Thu, Feb 25, 2021 at 9:48 AM Aleksander Machniak wrote: > On 23.02.2021 15:01, Nikita Popov wrote: > > While looking into various issues related to static variable handling, > I've > > become increasingly convinced that our handling of static variables in > > inherited methods is outright bugg

Re: [PHP-DEV] Inline conditional that returns null if falsy

2021-02-25 Thread Rowan Tommins
On 24/02/2021 04:26, Mike Schinkel wrote: Repeating code similar to that from the message sent by David Rodrigues you can see that eliminating the ": null" is less noisy: ... ... That's an interesting use case. Of course, the logical default there is actually '' (empty string) rat

Re: [PHP-DEV] [RFC] Static variables in inherited methods

2021-02-25 Thread Aleksander Machniak
On 23.02.2021 15:01, Nikita Popov wrote: > While looking into various issues related to static variable handling, I've > become increasingly convinced that our handling of static variables in > inherited methods is outright buggy. However, it's also long-standing > behavior, so I've put up an RFC:

Re: [PHP-DEV] [RFC] mysqli bind in execute

2021-02-25 Thread Claude Pache
> Le 11 févr. 2021 à 20:43, Kamil Tekiela a écrit : > > Hi internals, > > I am proposing the next change to improve mysqli extension. This RFC's goal > is to add a new optional parameter to mysqli_stmt:execute() that will take > an array of parameters. > > The RFC is located at https://wiki.p

Re: [PHP-DEV] [RFC] Static variables in inherited methods

2021-02-25 Thread Dmitry Stogov
+1 On Tue, Feb 23, 2021 at 5:02 PM Nikita Popov wrote: > Hi internals, > > While looking into various issues related to static variable handling, I've > become increasingly convinced that our handling of static variables in > inherited methods is outright buggy. However, it's also long-standing