note 127971 added to reserved.variables.globals
| From: | inafeeur at gmail dot com | Date: | Thu, 01 Dec 2022 08:25:31 +0000 |
| Subject: | note 127971 added to reserved.variables.globals | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219927@lists.php.net to get a copy of this message | ||
We can be more clear with the extension of the given example.
Before PHP Version 8.1
<?php
$a = 1;
$globals = $GLOBALS;
$globals['a'] = 2;
echo $a; // 2
echo $globals['a']; // 2
echo $GLOBALS['a']; // 2
?>
After PHP Version 8.1
<?php
$a = 1;
$globals = $GLOBALS;
$globals['a'] = 2;
echo $a; // 1
echo $globals['a']; // 2
echo $GLOBALS['a']; // 1
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 103.112.54.135)
----
Manual Page -- https://php.net/manual/en/reserved.variables.globals.php
Edit -- https://main.php.net/note/edit/127971
Del: integrated -- https://main.php.net/note/delete/127971/integrated
Del: useless -- https://main.php.net/note/delete/127971/useless
Del: bad code -- https://main.php.net/note/delete/127971/bad+code
Del: spam -- https://main.php.net/note/delete/127971/spam
Del: non-english -- https://main.php.net/note/delete/127971/non-english
Del: in docs -- https://main.php.net/note/delete/127971/in+docs
Del: other reasons-- https://main.php.net/note/delete/127971
Reject -- https://main.php.net/note/reject/127971
Search -- https://main.php.net/manage/user-notes.php