:sparkles: PHP 8.1: New `PHPCompatibility.ParameterValues.NewArrayMergeRecursiveWithGlobalsVar` sniff by jrfnl · Pull Request #1488 · PHPCompatibility/PHPCompatibility
Navigation Menu
{{ message }}
PHPCompatibility / PHPCompatibility Public
- Notifications You must be signed in to change notification settings
- Fork 204
Merged
Apr 20, 2023Conversation
Copy link Copy Markdown
Member
jrfnl
commented
Apr 5, 2023
jrfnl
commented
This change is a side-effect of the "Remove Indirect Modification of $GLOBALS" RFC, which removed the recursive $GLOBALS['GLOBALS'] key from the $GLOBALS array. Also see PR #1487
Access to the $GLOBALS array is now subject to a number of restrictions.
Read and write access to individual array elements like $GLOBALS['var']
continues to work as-is. Read-only access to the entire $GLOBALS array also
continues to be supported. However, write access to the entire $GLOBALS
array is no longer supported. For example, array_pop($GLOBALS) will result
in an error.
Refs:
- https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.globals-access
- https://github.com/php/php-src/blob/28a1a6be0873a109cb02ba32784bf046b87a02e4/UPGRADING#L23-L29
- https://wiki.php.net/rfc/restrict_globals_usage
- Restrict allowed usages of $GLOBALS php/php-src#6487
Includes unit tests.
Includes XML docs.
Related to #1299
…veWithGlobalsVar` sniff This change is a side-effect of the "Remove Indirect Modification of $GLOBALS" RFC, which removed the recursive `$GLOBALS['GLOBALS']` key from the `$GLOBALS` array. > Access to the $GLOBALS array is now subject to a number of restrictions. > Read and write access to individual array elements like $GLOBALS['var'] > continues to work as-is. Read-only access to the entire $GLOBALS array also > continues to be supported. However, write access to the entire $GLOBALS > array is no longer supported. For example, array_pop($GLOBALS) will result > in an error. Refs: * https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.globals-access * https://github.com/php/php-src/blob/28a1a6be0873a109cb02ba32784bf046b87a02e4/UPGRADING#L23-L29 * https://wiki.php.net/rfc/restrict_globals_usage * php/php-src#6487 Includes unit tests. Includes XML docs.
jrfnl
added
Type: enhancement
PR: ready for review
labels
jrfnl
added this to the
10.0.0 milestone
jrfnl
requested a review
from wimg
This was referenced
Apr 5, 2023wimg approved these changes Apr 20, 2023
wimg
merged commit
e878b5b
into
develop
wimg
deleted the
php-8.1/new-newarraymergerecursivewithglobalsvar-sniff
branch
github-actions
bot
removed
the
PR: ready for review
label
jrfnl
added
the
PHP: 8.1
label
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment