#23524 [Ver->Csd]: Improper handling of constants in array indeces.
| From: | iliaa@php.net | Date: | Wed, 11 Jun 2003 00:17:17 +0000 |
| Subject: | #23524 [Ver->Csd]: Improper handling of constants in array indeces. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-41645@lists.php.net to get a copy of this message | ||
ID: 23524
Updated by: iliaa@php.net
Reported By: d dot stogov at turck dot spb dot ru
-Status: Verified
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: Any
PHP Version: 4.3.2-RC3-dev
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-05-07 04:03:09] d dot stogov at turck dot spb dot ru
This bug exists in PHP version 4.1.2 - 4.3.1 and 5.0.0-dev.
It is similar to bug #18872 (Improper handling of class constants used
as default function argument values).
See the following PHP code:
<?php
function f($a=array(PHP_VERSION=>PHP_VERSION)) {
print_r($a);
echo "<br>\n";
}
f();
f();
?>
The function "f" should print the same result at first and at second
invocation but it is not true. The output is:
Array
(
[4.3.1] => 4.3.1
)
<br>
Array
(
[PHP_VERSION] => 4.3.1
)
<br>
The error is in handling of "ZEND_RECV_INIT" opcode and in
function "zval_update_constant" that resets "IS_CONSTANT_INDEX" flag in
original "zval" instead of copy.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23524&edit=1