Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108665 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76990 invoked from network); 19 Feb 2020 16:20:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Feb 2020 16:20:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EF9171804DA for ; Wed, 19 Feb 2020 06:36:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 19 Feb 2020 06:36:45 -0800 (PST) Received: by mail-lf1-f66.google.com with SMTP id z5so258148lfd.12 for ; Wed, 19 Feb 2020 06:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=WLR/dWJhdeekH2gf7x1ViO3/uHJ5uN85CDN3dqAz6AE=; b=LItFEtVnjRuQvvS/Az59uLUCE7NINZrkVFSpuOXHQzZCKJP7oZfOJ02KQoivfZoz3C cRvBvaCkTcZTL40hhCjSRoXzGxfHT7TTkJ7xiRaSaWS3vrb3iK7eoZN5TkZaV7c0H+NK 0bOwNPPiOEmn1bnn3tRAvu+RJPizXUgzH/Y8yMi8MfK80s65svDIHEdZ7HLJBv4EbWl8 uhwzeDJN7ribZ9s/q4DJzGGom4DMUcUjnEftcTV8CrbmkTSGbJqNdzS5nIogLMZfK+nT POdCnuYyguVJOH5lnc1KfrVfrLI/zdkPCUnKnZatmC3UY33xyPQlSJI+YJuczGBhEE/E JJYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=WLR/dWJhdeekH2gf7x1ViO3/uHJ5uN85CDN3dqAz6AE=; b=uKxHo+RA7yT0mND6UBEkNIHw+S9Ewt7wXoTjmzVqq01jWRWX7yOfXFXUXGplE4oZYW 5l0LJgo2rGOP013d7G4v1V33NCxYM/5cJ57Ie44sE8oJCJhhYU561q8X0XUOO3EXHT6s KOyq2nMjXGAkYpdhwV9VPlItZN7m7YaLtCj0n3nmV2pA+HM5jhHmpK7nTJpi6gB/lb5U QLl7ZHMukRNazBG/vJP+6bENZX7KzfGQ1uPHRC4NuH1KRFeVhSIhgBxQdaYuC+4IKEo+ 2f1BaxVDJQbjwCYgKmrhGYqx8Qy888eQ1agnrH6mom9Boe0Iwc3Rs7xNWcLGCAd2jnJJ jYsg== X-Gm-Message-State: APjAAAURr2GTtUuFkq8Q+8+5SvPfI5JReecD7q3J8e8l2N/NQR9mg63d y8bB9UN6GUC2IsPzXB6jER7Rk5yJ8rtTXhjXRbIIHJGc X-Google-Smtp-Source: APXvYqwZ+CZfJyAHQCSjgLKEaD7HRtl4xuokbe1zye/NZP+RrfcLRNWQQVgJH1ZjNygrf375XP05aZdqMMAeUlsn+ZU= X-Received: by 2002:a19:c1c9:: with SMTP id r192mr13791143lff.28.1582123003927; Wed, 19 Feb 2020 06:36:43 -0800 (PST) MIME-Version: 1.0 Date: Wed, 19 Feb 2020 15:36:33 +0100 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000a3e12a059eeeb7a4" Subject: New PCRE function From: nicoswd@gmail.com (Nico Oelgart) --000000000000a3e12a059eeeb7a4 Content-Type: text/plain; charset="UTF-8" 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! --000000000000a3e12a059eeeb7a4--