mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

This restricts allowed usage of $GLOBALS, with the effect that plain PHP arrays can no longer contain INDIRECT elements. RFC: https://wiki.php.net/rfc/restrict_globals_usage Closes GH-6487.
10 lines
229 B
PHP
10 lines
229 B
PHP
--TEST--
|
|
Cannot use $GLOBALS as foreach result variable (by-ref)
|
|
--FILE--
|
|
<?php
|
|
|
|
foreach ([1] as &$GLOBALS) {}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
|