New PCRE function
| From: | Nico Oelgart | Date: | Wed, 19 Feb 2020 14:36:33 +0000 |
| Subject: | New PCRE function | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-108665@lists.php.net to get a copy of this message | ||
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!