Re: New PCRE function
| From: | David Rodrigues | Date: | Wed, 19 Feb 2020 15:20:00 +0000 |
| Subject: | Re: New PCRE function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108669@lists.php.net to get a copy of this message | ||
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
Em qua., 19 de fev. de 2020 às 11:37, Nico Oelgart <nicoswd@gmail.com>
escreveu:
> 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 the documentation are
> about converting those to something more user friendly.
>
> https://www.php.net/preg_last_error#usernotes
>
> Besides, most extensions provide multiple functions for both
> use-cases natively, such as:
>
> - json (json_last_error / json_last_error_msg)
> - socket (socket_last_error / socket_strerror)
> - sqlite (sqlite_last_error / sqlite_error_string)
> - ldap (ldap_errno / ldap_error)
> - etc...
>
> So I think it makes sense for this function to exist.
>
> Any thoughts?
>
> Thank you!
>