|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-12-17 12:42 UTC] jani@php.net
-Summary: Declare variables as constants
+Summary: Declare constant variables
-Package: Feature/Change Request
+Package: Scripting Engine problem
-Operating System: Linux
+Operating System: *
-PHP Version: 4.0.4pl1
+PHP Version: *
[2015-02-17 08:38 UTC] krakjoe@php.net
-Status: Open
+Status: Wont fix
[2015-02-17 08:38 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
PHP 4 doesn't seem to have the capability to define variables of all types as being constants. An example of this could be: $stuff = (const)array('1','2'); or $stuff = const($stuff); An error would be generated if the script later tried to: $stuff = array('3','2'); This is *not* the same as CONSTANTS like TRUE and FALSE. This would be extremely useful with sessions, so other programmers don't clobber important session variables that shouldn't change.