[PHP-DEV] Can we make str_(starts|ends)_with variadic?

2025-06-10 Thread Hans Henrik Bergan
Can we make str_(starts|ends)_with variadic? PR: https://github.com/php/php-src/pull/18825 Code like ```php if (str_starts_with($url, "http://";) || str_starts_with($url, "https://";)) { // url } if (str_ends_with($filename, ".pdf") || str_ends_with($filename, ".doc") || str_ends_with($filenam

Re: [PHP-DEV] Feature Discussion |

2025-06-10 Thread Dmitry Derepko
Thanks for participating, Larry. On Mon, Jun 9, 2025 at 10:29 PM Larry Garfield wrote: > 2. Please link to a PR of your actual implementation. In context it looks > like your branch comparison link is to the version you said didn't work, so > it's not that helpful. > Correct, I don't have an

Re: [PHP-DEV] Can we make str_(starts|ends)_with variadic?

2025-06-10 Thread Niels Dossche
I think I like it, it seems convenient and I had to do stuff like this in the past using a loop. I don't immediately see a technical reason why this would be a bad idea. Kind regards Niels

Re: [PHP-DEV] Feature Discussion |

2025-06-10 Thread Rob Landers
On Tue, Jun 10, 2025, at 22:09, Larry Garfield wrote: > On Tue, Jun 10, 2025, at 2:45 PM, Dmitry Derepko wrote: > > Thanks for participating, Larry. > > > > On Mon, Jun 9, 2025 at 10:29 PM Larry Garfield > > wrote: > >> 2. Please link to a PR of your actual implementation. In context it looks >

Re: [PHP-DEV] Feature Discussion |

2025-06-10 Thread Larry Garfield
On Tue, Jun 10, 2025, at 2:45 PM, Dmitry Derepko wrote: > Thanks for participating, Larry. > > On Mon, Jun 9, 2025 at 10:29 PM Larry Garfield wrote: >> 2. Please link to a PR of your actual implementation. In context it looks >> like your branch comparison link is to the version you said didn't

Re: [PHP-DEV] Feature Discussion |

2025-06-10 Thread Dmitry Derepko
I see. The first thought is about extending the class definition: along with functions hashtable we would add virtual functions HT and lookup for the function will be another HT lookup. [image: image.png] That for sure is better than trap for cpu, but enlarge memory usage at the moment. --- M

Re: [PHP-DEV] Feature Discussion |

2025-06-10 Thread Rob Landers
On Wed, Jun 11, 2025, at 08:31, Dmitry Derepko wrote: > I see. > > The first thought is about extending the class definition: along with > functions hashtable we would add virtual functions HT and lookup for the > function will be another HT lookup. > > image.png > > That for sure is better th