Re: [PHP-DEV] New PCRE function

2020-02-21 Thread Nico Oelgart
On Thu, Feb 20, 2020 at 10:12 AM Nikita Popov wrote: > FWIW, it is our established stance that all error messages must be > capitalized. Lower-case first character is only permitted if it is part of > a function name, or similar cases. > Thanks for clearing this up, Nikita. Given that, I think

Re: [PHP-DEV] New PCRE function

2020-02-20 Thread Mike Schinkel
> On Feb 20, 2020, at 4:11 AM, Nikita Popov wrote: > > FWIW, it is our established stance that all error messages must be > capitalized. Lower-case first character is only permitted if it is part of > a function name, or similar cases. Fair enough. -Mike -- PHP Internals - PHP Runtime

Re: [PHP-DEV] New PCRE function

2020-02-20 Thread Nikita Popov
On Wed, Feb 19, 2020 at 6:36 PM Rowan Tommins wrote: > On Wed, 19 Feb 2020 at 17:15, Mike Schinkel wrote: > > > From https://github.com/golang/go/wiki/CodeReviewComments#error-strings > > > > "Error strings should not be capitalized (unless beginning with proper > > nouns or acronyms) or end

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread Mike Schinkel
> On Feb 19, 2020, at 12:27 PM, G. P. B. wrote: > > But that's Golang's policy, The intent was not to present someone else's policy but to instead show prior art. > so either we change all error messages to be lower case or we keep it > consistent with what PHP currently does. > Moreover,

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread Mike Schinkel
> On Feb 19, 2020, at 12:35 PM, Rowan Tommins wrote: > > Thanks, I can see the reasoning, although I'm not sure I agree with it. > > If you're only showing it to a programmer, worrying about the grammar of a > capital letter after a colon seems needlessly pedantic. If you're showing > it to

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread Rowan Tommins
On Wed, 19 Feb 2020 at 17:15, Mike Schinkel wrote: > From https://github.com/golang/go/wiki/CodeReviewComments#error-strings > > "Error strings should not be capitalized (unless beginning with proper > nouns or acronyms) or end with punctuation, since they are usually printed > following other

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread G. P. B.
On Wed, 19 Feb 2020 at 18:15, Mike Schinkel wrote: > > On Feb 19, 2020, at 12:10 PM, Rowan Tommins > wrote: > > > >>> On Wed, Feb 19, 2020 at 4:20 PM David Rodrigues < > david.pro...@gmail.com> > >>> wrote: > >>> > Maybe you can set all this messages as lowercase? That way we can use > it

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread Mike Schinkel
> On Feb 19, 2020, at 12:10 PM, Rowan Tommins wrote: > >>> On Wed, Feb 19, 2020 at 4:20 PM David Rodrigues >>> wrote: >>> Maybe you can set all this messages as lowercase? That way we can use it more easily. >> > > > >> On Wed, 19 Feb 2020 at 16:50, Mike Schinkel wrote: >> >> I

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread Rowan Tommins
> > On Wed, Feb 19, 2020 at 4:20 PM David Rodrigues > > wrote: > > > >> Maybe you can set all this messages as lowercase? That way we can use it > >> more easily. > > On Wed, 19 Feb 2020 at 16:50, Mike Schinkel wrote: > > I am however influenced by Go which specifies that all error messages >

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread Mike Schinkel
> On Feb 19, 2020, at 10:33 AM, Nico Oelgart wrote: > > On Wed, Feb 19, 2020 at 4:20 PM David Rodrigues > wrote: > >> Maybe you can set all this messages as lowercase? That way we can use it >> more easily. If we need the first letter in capital letters we can use >> `ucfirst()`, because the

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread Nico Oelgart
On Wed, Feb 19, 2020 at 4:20 PM David Rodrigues wrote: > Maybe you can set all this messages as lowercase? That way we can use it > more easily. If we need the first letter in capital letters we can use > `ucfirst()`, because the opposite is more complicated (a `strtolower()` > would "break" the

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread David Rodrigues
Maybe you can set all this messages as lowercase? That way we can use it more easily. If we need the first letter in capital letters we can use `ucfirst()`, because the opposite is more complicated (a `strtolower()` would "break" the "JIT" message, for example). Atenciosamente, David Rodrigues

[PHP-DEV] New PCRE function

2020-02-19 Thread Nico Oelgart
Hi Internals, I've submitted a small PR proposing a new PCRE function that returns a human-friendly string representation of the last error. https://github.com/php/php-src/pull/5185 Currently there's only preg_last_error() which returns error codes, which isn't really helpful. Most comments in