ID:               34752
 Updated by:       [EMAIL PROTECTED]
 Reported By:      trash at jennyfm dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         Scripting Engine problem
 Operating System: linux 2.6.13
 PHP Version:      5.0.5
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.




Previous Comments:
------------------------------------------------------------------------

[2005-10-06 10:58:10] trash at jennyfm dot net

Description:
------------
foreach seam to overwrite values in array ..... 
it works fine in 5.0.4 but in 5.0.5 not.
don't know why...

Reproduce code:
---------------
full class source here: http://kuerbis.org/template/show_source.php
class Template extends KTemplate {
...........
  protected function _initTemplate()
        {
            parent::_initTemplate();
            if (isset($this->bl) && is_array($this->bl))
            {
            print_r($this->bl);
            //before foreach bl is ok in 5.0.4 and 5.0.5
                foreach ($this->bl as $key => $value)
                {
                    $this->blc[$key] = true;
                }
            //after foreach bl is overwritten in 5.0.5, in 5.0.4 it
works
            print_r($this->bl);
            }
        }
......
}

Expected result:
----------------
in php 5.0.4 i get (after the foreach)
.......
Array
(
    [mainmenu] => KTemplateExt Object
        (
            [removeEmptyBlocks] => 1
            [delimiterStart:protected] => {
            [delimiterEnd:protected] => }
            [t:protected] =>                
                        {menu_title}

            [pl:protected] => 
            [bl:protected] => 
            [templatefile:protected] => 
            [className:protected] => KTemplateExt
            [params] => 
        )

)
.... and so on

Actual result:
--------------
in php 5.0.5 i get (after the foreach)

(
    [menublock] => Array
        (
            [menublock] => 1
            [not_logged_in] => 1
            [logged_in] => 1
        )

    [not_logged_in] => 1
    [logged_in] => 1
)

.... and so on


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34752&edit=1

Reply via email to