note 124124 added to function.preg-last-error

From: Date: Sun, 18 Aug 2019 09:37:10 +0000
Subject: note 124124 added to function.preg-last-error
Groups: php.notes 
Request: Send a blank email to php-notes+get-211947@lists.php.net to get a copy of this message
Here is a correction to one of the previous "get error message" snippets. It filters out the non-error codes which stops "Warning: array_flip(): Can only flip STRING and INTEGER values!" from being emitted due to ["PCRE_JIT_SUPPORT"]=>bool(true): <?php echo array_flip(array_filter(get_defined_constants(true)['pcre'], function ($value) { return substr($value, -6) === '_ERROR'; }, ARRAY_FILTER_USE_KEY))[preg_last_error()]; ---- Server IP: 208.43.231.9 Probable Submitter: 82.199.157.54 (proxied: 211.30.51.139) ---- Manual Page -- http://php.net/manual/en/function.preg-last-error.php Edit -- https://master.php.net/note/edit/124124 Del: integrated -- https://master.php.net/note/delete/124124/integrated Del: useless -- https://master.php.net/note/delete/124124/useless Del: bad code -- https://master.php.net/note/delete/124124/bad+code Del: spam -- https://master.php.net/note/delete/124124/spam Del: non-english -- https://master.php.net/note/delete/124124/non-english Del: in docs -- https://master.php.net/note/delete/124124/in+docs Del: other reasons-- https://master.php.net/note/delete/124124 Reject -- https://master.php.net/note/reject/124124 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#211947) next »