Bug #12964 Updated: direct access to an array fails but walkthrough by foreach works
| From: | mfischer@php.net | Date: | Sun, 26 Aug 2001 11:46:17 +0000 |
| Subject: | Bug #12964 Updated: direct access to an array fails but walkthrough by foreach works | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-64345@lists.php.net to get a copy of this message | ||
ID: 12964
Updated by: mfischer
Reported By: jan@kneschke.de
Old Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.0.6
New Comment:
Jan,
It's our all paperbag since you consultet a few not-so-newbie people before submitting ... ;-)
cheers,
Markus
--
All the paperbags are belong to #php.de
Previous Comments:
------------------------------------------------------------------------
[2001-08-26 06:26:20] jan@kneschke.de
It seems that I've reached one of the borders of PHP/Zend.
I'm coding a qt-like environment called pasta which
results in a quite large class-tree. This is a problem for
PHP as it looses a some parts of the class:
The code:
print_r($this->sec_global);
print "incpath:
".$this->sec_global["includepath"]."\n";
foreach($this->sec_global as $k => $v) {
print "$k -- $v<br />";
}
results in the following output:
Array
(
["debug_level"] => 0
["incremental"] => 0
["enable_resolver"] => 1
["outputdir"] =>
["include"] =>
["includepath"] => ../etc/
)
Warning: Undefined index: includepath in
/pages/projects/modlogan/mlaconfiggen.php on line 262
incpath:
"debug_level" -- 0
"incremental" -- 0
"enable_resolver" -- 1
"outputdir" --
"include" --
"includepath" -- ../etc/
As you can see a print_r and foreach display the same
result. The array is filled with these data like I've
expected it. But a direct access to the array results in a
'undefined index' which looks very odd to me.
This problem exists for other class variables of this
class too:
Undefined property: processorplugin ...
This happens in the default branch of a switch.
The full code can be found at
http://jan.kneschke.de/showsource.php?page=%2Fprojects%2Fmodlogan%2Fmlaconfiggen.php
The output is at
http://jan.kneschke.de/projects/modlogan/mlaconfiggen.php
(click 3 times on the '-->', fill in some data into the
4th page and click on '-->' again. This will result in the
described behaviour which has been reproduced with
PHP4.0.6 and PHP4.0.7rc1)
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12964&edit=1