Req #67334 [NEW]: I can change the constant value using define method.
| From: | gangadhar dot kasim at gmail dot com | Date: | Fri, 23 May 2014 11:35:18 +0000 |
| Subject: | Req #67334 [NEW]: I can change the constant value using define method. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185910@lists.php.net to get a copy of this message | ||
From: gangadhar dot kasim at gmail dot com
Operating system: Windows
PHP version: 5.4.28
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:I can change the constant value using define method.
Description:
------------
If I pass the optional third parameter in DEFINE method as TRUE, it is
allowing me to override the existing value of a constant. This is not
the expected behavior as constant's value should not be changed once it
is declared.
Test script:
---------------
define("GREETING", "Hello you.",true);
echo GREETING; // outputs "Hello you."
echo "before changing the constant value <br/>"; //before changing the
constant value
define("GREETING", "sample value.");
echo GREETING; // outputs "sample value."
echo "<br/>";
Expected result:
----------------
constant's value should not be changed once it is declared.
Actual result:
--------------
it is allowing me to override the existing value of a constant.
--
Edit bug report at https://bugs.php.net/bug.php?id=67334&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67334&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67334&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67334&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67334&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67334&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67334&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67334&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67334&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67334&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67334&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67334&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67334&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67334&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67334&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67334&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67334&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67334&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67334&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67334&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67334&r=mysqlcfg