Bug->Doc #54657 [Opn->Csd]: Function parameters can no longer be named after superglobal variables

From: Date: Wed, 07 Sep 2011 15:28:15 +0000
Subject: Bug->Doc #54657 [Opn->Csd]: Function parameters can no longer be named after superglobal variables
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7155@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54657&edit=1 ID: 54657 Updated by: cataphract@php.net Reported by: cataphract@php.net Summary: Function parameters can no longer be named after superglobal variables -Status: Open +Status: Closed -Type: Bug +Type: Documentation Problem Package: Scripting Engine problem Operating System: Any PHP Version: trunk-SVN-2011-05-04 (SVN) -Assigned To: +Assigned To: cataphract Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2011-09-07 15:27:59] cataphract@php.net Automatic comment from SVN on behalf of cataphract Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=316364 Log: - Fixed doc bug #54657: Function parameters can no longer be named after superglobal variables. ------------------------------------------------------------------------ [2011-05-04 14:04:51] cataphract@php.net Description: ------------ There is a backwards incompatible change in trunk in that function can no longer have parameters with a name equal to the one of some superglobal. This should either be fixed with the previous behavior (the parameter shadows the superglobal) or documented in UPGRADING. Test script: --------------- $ php -d error_reporting=-1 <?php function a($GLOBALS) { $GLOBALS['h'] = 8; } $g = null; a($g); var_dump($h); Expected result: ---------------- On 5.3: Notice: Undefined variable: h in - on line 7 NULL Actual result: -------------- On trunk: Fatal error: Cannot re-assign auto-global variable GLOBALS in - on line 2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54657&edit=1

« previous php.doc.bugs (#7155) next »