Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Ayesh Karunaratne
> > Hi, > > What do y'all think about requiring GPG signed commits for the php-src > repository? > > I had a look, and this is also something we can enforce through GitHub > as well (by using branch protections). > > cheers, > Derick > > > -- > https://derickrethans.nl | https://xdebug.org |

Re: [PHP-DEV][RFC] grapheme cluster for str_split, grapheme_str_split function

2024-03-25 Thread Ayesh Karunaratne
> > 2024年3月9日(土) 15:26 youkidearitai : > > > > Hello, Internals > > > > I created an wiki for `grapheme_str_split` function. > > Please see: > > https://wiki.php.net/rfc/grapheme_str_split > > > > I would like to "Under Discussion" section. > > > > Best Regards > > Yuya > > > > -- > >

Re: [PHP-DEV] [RFC] [Discussion] Deprecate GET/POST sessions

2024-03-04 Thread Ayesh Karunaratne
> > Hi Internals, > > I would like to start a discussion on a new RFC > https://wiki.php.net/rfc/deprecate-get-post-sessions > > Please let me know whether the idea is clear and the RFC is understandable. > > In particular, I am looking for any feedback as to why this is a bad > idea. The primary

Re: [PHP-DEV] int|float for sleep? sleep(0.1) => sleep 0.1 seconds

2024-02-29 Thread Ayesh Karunaratne
> > Made a RFC draft: https://wiki.php.net/rfc/sleep_function_float_support > > First time, so I'm not surprised if there are some mistakes there. > > Feedback is very welcome. > Hi Hans, The RFC looks great, and I am personally positive to see these proposed changes implemented in PHP. One

Re: [PHP-DEV] int|float for DateTime::setTimestamp

2024-02-13 Thread Ayesh Karunaratne
> > just like the constructor accepts > new DateTime("@0.123456"); // 1970-01-01 00:00:00.123456 > new DateTime("@".microtime(true)); > > IMO setTimestamp should accept the same: > $dt->setTimestamp(0.123456); // 1970-01-01 00:00:00.123456 > $dt->setTimestamp(microtime(true)); > > Can we change

Re: [PHP-DEV][VOTE][RFC] mb_ucfirst and mb_lcfirst functions

2024-02-06 Thread Ayesh Karunaratne
> > I see. I'll change mb_ucfirst using titlecase. > > Per my comments a month ago on the GitHub issue , I think it is much > better to use title case for mb_ucfirst() than to use upper case, > since conversion of the first character to upper case has the effect > of corrupting text in the

Re: [PHP-DEV][VOTE][RFC] mb_ucfirst and mb_lcfirst functions

2024-02-02 Thread Ayesh Karunaratne
> > On Fri, Feb 2, 2024 at 2:00 AM youkidearitai > wrote: > > > Hi, Internals > > > > I have just opened the voting "Multibyte ucfirst and lcfirst functions" > > RFC. > > https://wiki.php.net/rfc/mb_ucfirst > > > > Voting will be open until February 26th, 2024 at 01:00 UTC. > > > > Cheers > >

Re: [PHP-DEV] [RFC] Deprecate implicitly nullable parameter type

2024-01-23 Thread Ayesh Karunaratne
> > I just encountered this language inconsistency when trying to remove > nullable from a constructor-promoted property: > > ``` > class MyClass > { > public function __construct( > public ?string $title = null // removing "?" here causes "Fatal > error: Cannot use null as default

Re: [PHP-DEV] Filesystem path APIs

2023-12-06 Thread Ayesh Karunaratne
> > There could be OOP-style alternatives too, e.g. Rust has a PathBuf struct > with methods that are used to build paths. > However if we were to choose this route then we need to be aware that > interoperability with existing filesystem functions would be much harder > because they all work

Re: [PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-29 Thread Ayesh Karunaratne
> Shift_JIS is very ambiguous, What will we do if SJIS-2004 or SJIS-win comes? > How do we guess(detect) SJIS-2004, SJIS-win and SJIS-mac? I'm not the person you replied to in your previous email, but I thought to weigh in with what I can. My native language also uses multiple bytes, and have

Re: [PHP-DEV] What is the prevailing sentiment about extract() and compact() ?

2023-11-29 Thread Ayesh Karunaratne
> > try { > // do stuff > } catch(Throwable $exception) { > $this->logger->error("failed to do stuff", compact('exception')); > throw $exception; > } > I wonder why not just create an array with the key... ```php try { // do stuff } catch(Throwable $exception) {

Re: [PHP-DEV] [PDO] I want to unify the behavior when changing the autocommit mode setting while a transaction is open.

2023-11-27 Thread Ayesh Karunaratne
> > Hi, > > > In the latter case, I suppose they would expect the behaviour to be > > compliant with the database standards. > > I may not have had this perspective. And this is a strong basis for > explaining that different drivers behave differently. > > I will continue with the current

Re: [PHP-DEV] [RFC] [Discussion] Resource to object conversion

2023-11-22 Thread Ayesh Karunaratne
> More importantly, it is possible to write cross compatible code, even > without changing anything about is_resource(), if we convert streams to > opaque objects. > It might be tedious and one might need to have redundant instanceof checks > with is_resource() if one does not want to check for a

Re: [PHP-DEV] Fix the inconsistent behavior of PDO::PARAM_XXX

2023-11-04 Thread Ayesh Karunaratne
> > Hi internals, > > As shown in the following issue, the behavior of `PDO::PARAM_` is > inconsistent and I would like to fix this. > https://github.com/php/php-src/issues/12603 > > First, I tried fixed pdo_pgsql. > https://github.com/php/php-src/pull/12605 > > Eventually I plan to make

Re: [PHP-DEV] Two new functions array_first() and array_last()

2023-10-14 Thread Ayesh Karunaratne
> > PHP lacks two very basic functions for working with arrays: > > - array_first() returning the first element of an array (or null) > - array_last() returning the last element of the array (or null) > > While PHP has functions that return the first and last keys, > array_key_first() and

Re: [PHP-DEV] Proposal to unbundle imap/pspell/oci8 extensions for PHP 8.4

2023-09-13 Thread Ayesh Karunaratne
> > ext/imap > > > > The library that provides the functionality in this extension, c-client, > > is no longer updated. The last release from 2007 is no longer available > > on the original distributor's (University of Washington) website, but > > there is an unofficial GitHub repository that

Re: [PHP-DEV] RFC json_validate() - status: Under Discussion

2022-08-26 Thread Ayesh Karunaratne
> whether returning boolean is the right thing to do at all. It seems obviously > intuitive it should, returning true for valid and false for invalid JSON > but then if you consider you're still going to be in the situation of > calling json_last_error() if you want to know why invalid JSON was

Re: [PHP-DEV] Removing Travis CI

2022-07-10 Thread Ayesh Karunaratne
Awesome, thanks a lot for this. On Mon, Jul 11, 2022 at 1:50 AM Nikita Popov wrote: > > On Sun, Jul 10, 2022 at 10:07 PM Ayesh Karunaratne wrote: >> >> Dear Internals, >> Historically, we have been using Travis CI for our automated tests, >> but since 2021

[PHP-DEV] Removing Travis CI

2022-07-10 Thread Ayesh Karunaratne
Dear Internals, Historically, we have been using Travis CI for our automated tests, but since 2021 June, travis-ci.org has ceased operations, and no longer runs any builds. There was an Internals discussion (https://externals.io/message/112709) to move to the successor, travis-ci.com, but I don't

Re: [PHP-DEV] Windows PECL build machine died

2022-04-08 Thread Ayesh Karunaratne
With php-src's recently starting to Github Actions, would it be possible for PECL builds to use Github Actions with Windows. It supports Windows server 2016, 2019, and even 2022 (IIRC). On Fri, Apr 8, 2022 at 5:17 PM Christoph M. Becker wrote: > > Hi all, > > bad news: the Windows PECL build

Re: [PHP-DEV] Pre-RFC: Redacting parameters in back traces (SensitiveParameter Attribute)

2022-01-07 Thread Ayesh Karunaratne
Hi Tim, Thank you for opening the discussion. I personally find this feature useful, and glancing at the diff, it looks like a rather straightforward and minimal change. FWIW, it is possible to selectively expose class properties in a class object being `var_dump`-ed with the `__debugInfo` magic

Re: [PHP-DEV] header() allows arbitrary status codes

2021-12-21 Thread Ayesh Karunaratne
> > Hi all, > > a while ago it has been reported[1] that our header() function actually > allows arbitrary status codes, which may even overflow. Of course, that > makes no sense, since the status code is supposed to be a three digit > code. So this ticket has been followed up by a pull

Re: [PHP-DEV] PHP Foundation

2021-11-22 Thread Ayesh Karunaratne
Hi Nikita, Thank you so much for what you have done for PHP, the language and the community we all are in. I can't muster enough words to say how grateful I am to you for all the changes we have in PHP all these years. From every commit I see from you, to every podcast I listen to, from every PR

Re: [PHP-DEV] Unbreak git.php.net links?

2021-10-10 Thread Ayesh Karunaratne
es, > > etc. I have added support for a static list that maps git.php.net > > names to GitHub repo under `php` organization namespace. > > > > oh i see. > > > > fwiw, your implementation looks more professional / enterprise-y :) > > > > > > On Tu

Re: [PHP-DEV] Unbreak git.php.net links?

2021-10-05 Thread Ayesh Karunaratne
> here is an initial implementation: > https://github.com/divinity76/git-php-net-redirector/blob/main/src/redirector.php > it is just a minimum-effort implementation, anyone feel free to make > something better (also i have no idea how the "p" argument is supposed to > be parsed, so i just

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-25 Thread Ayesh Karunaratne
> > Hi internals, > > I'd like to propose the deprecation of "dynamic properties", that is > properties that have not been declared in the class (stdClass and > __get/__set excluded, of course): > > https://wiki.php.net/rfc/deprecate_dynamic_properties > > This has been discussed in various forms

Re: [PHP-DEV] [RFC] Add parse_query_string as an alternative to parse_str

2021-08-06 Thread Ayesh Karunaratne
> I agree about the _string suffix removal. However, I know we have > parse_url() already, but parse_query() might be too generic. I would > suggest adding "http" to the name. And as we already have > http_build_query() I would rather see http_parse_query(). > +1 for http_parse_query() as it

Re: [PHP-DEV] RFC: autoconst

2021-08-01 Thread Ayesh Karunaratne
> > Hello! > > This is my first RFC proposal. I have an idea about introducing autoconst > keyword. > Motivation: > reduce duplicated code (copy/pasting constant name as value) > reducing potential typo errors in constant values > > instead of defining constants like: > const FOO = 'FOO'; > >

Re: [PHP-DEV] Proposal: clamp

2021-06-23 Thread Ayesh Karunaratne
> Greetings internals, > > I present to you a proposal for a new basic math function: clamp. > > The main goal of this function is to contain a number inside a given bound. > And return the number if it is inside of that bound, and if not, and the > number is outside of the given bound, the

Re: [PHP-DEV] Propagating AVIF support from libgd into PHP's bundled gd

2021-06-06 Thread Ayesh Karunaratne
> > Den søn. 6. jun. 2021 kl. 00.09 skrev Ayesh Karunaratne : > > > > Hi Ben, > > Thank you for opening this PR and the discussion. With the wide > > availability of AVIF/AV1 support in browsers, I think this will fit > > nicely. > > > > We have the

Re: [PHP-DEV] Propagating AVIF support from libgd into PHP's bundled gd

2021-06-05 Thread Ayesh Karunaratne
Hi Ben, Thank you for opening this PR and the discussion. With the wide availability of AVIF/AV1 support in browsers, I think this will fit nicely. We have the Namespaces in Bundled Extensions RFC (https://wiki.php.net/rfc/namespaces_in_bundled_extensions) passed, so perhaps, the new functions

Re: [PHP-DEV] json_encode indent parameter

2021-06-03 Thread Ayesh Karunaratne
Hi Timon, Thank you for this RFC. I think the `string|int $indent` approach is great ! Reading the PR, it looks like `$indent=0` is essentially turning off pretty-print, which I think is intuitive. Do you plan to add any sort of validation on negative integers? Perhaps throw a `\ValueError`

Re: [PHP-DEV] [RFC] Deprecate ticks

2021-05-11 Thread Ayesh Karunaratne
> > Hi Nikita, > > wt., 11 maj 2021 o 10:53 Nikita Popov napisał(a): > > > Hi internals, > > > > I'd like to propose the depreciation of the ticks mechanism: > > https://wiki.php.net/rfc/deprecate_ticks > > > > I'm submitting this separately from the PHP 8.1 deprecations RFC, as this > > is a

Re: [PHP-DEV] add php.ini entry to set default user_agent for curl

2021-04-08 Thread Ayesh Karunaratne
Hi Michael, Thanks for opening this conversation and the PR. Most HTTP client libraries that need to set a custom user agent do so with `curl_setopt` because it needs to contain a library version or some sort of dynamic values. They will likely not benefit from this change. On the other hand,

Re: [PHP-DEV] Changes to Git commit workflow

2021-03-28 Thread Ayesh Karunaratne
I think this is a great step forward. With commit signatures required, I think the person who merges a PR now needs to do so locally. [GitHub CLI](https://cli.github.com/) helps me a lot to locally checkout a PR quickly, and then rebase/squash with my own signature. Thanks to Levi Morrison and

Re: [PHP-DEV] include vendor/autoload.php automatically

2021-03-27 Thread Ayesh Karunaratne
Larry already mentioned `auto_append_file` that I also think is the way to go, if it fits. The example directory structure from your email is also considered insecure, because without proper web-server protection, you are essentially exposing _all_ `vendor` files, including the ones that

Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode?

2021-03-21 Thread Ayesh Karunaratne
Thank you for opening this conversation, these functions have stung me in the past, and I would be so happy to see them gone :) Personally, I would very much like to go with Plan A. - XML parsers that often deal with non-UTF-8 character encodings frequently use these functions. However, any

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

2021-03-19 Thread Ayesh Karunaratne
Please ignore my last message :( Hi Internals, I did a somewhat rough test to compare Composer's autoloader and the function proposed in the RFC. ## TL;DR: autoload_set_classmap over Composer with OPCache: 8.12% autoload_set_classmap over Composer without OPCache: 7.93% ## Long version: