#22972 [Opn->WFx]: Addition to the global keyword

From: Date: Tue, 01 Apr 2003 08:15:58 +0000
Subject: #22972 [Opn->WFx]: Addition to the global keyword
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-36896@lists.php.net to get a copy of this message
ID: 22972 Updated by: pollita@php.net Reported By: tim dot stebbing at nunatak dot com dot au -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.3.1 New Comment: The general consensus seems to be that this feature will not be added. A simple workaround which you can implement in your code to achieve the 'neatening up' you're going for is: function bar() { global $aVeryLongVariableName; $foo = &$aVeryLongVariableName; /* This will successfully increment the value of $aVeryLongVariableName */ $foo++; } Previous Comments: ------------------------------------------------------------------------ [2003-03-30 23:08:11] tim dot stebbing at nunatak dot com dot au optionaly add 'as' to the global keyword, in the same way that SQL 'as' works: global $aVeryLongVariableName as $foo It would neaten alot of code, would not break old scripts, I imagine your passing a ref into the code block, this is just specifying the handle used :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22972&edit=1

« previous php.bugs (#36896) next »