[web-php] master: Modernize a term lookup map slightly

From: Date: Sun, 04 Jul 2021 23:01:24 +0000
Subject: [web-php] master: Modernize a term lookup map slightly
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-29398@lists.php.net to get a copy of this message
Author: Sara Golemon (sgolemon) Date: 2021-07-04T23:01:16Z Commit: https://github.com/php/web-php/commit/f5737afaf54b2b14c311771a22c86b55114d845a Raw diff: https://github.com/php/web-php/commit/f5737afaf54b2b14c311771a22c86b55114d845a.diff Modernize a term lookup map slightly Changed paths: M include/errors.inc Diff: diff --git a/include/errors.inc b/include/errors.inc index 74408841d..f143ff2fb 100644 --- a/include/errors.inc +++ b/include/errors.inc @@ -507,13 +507,8 @@ $snippets = array( See also the list of <a href="/extensions">PHP extensions</a>', ); - $term = strtolower(trim($term)); - if (isset($term[0]) && $term[0] === '$') { - $term = ltrim($term, '$'); - } - - return isset($snippets[$term]) ? $snippets[$term] : false; - + $term = ltrim(strtolower(trim($term)), '$'); + return $snippets[$term] ?? false; } /**

« previous php.webmaster (#29398) next »