ID: 14002
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Arrays related
Operating System: unix
PHP Version: 4.0.4pl1
New Comment:

Could just test it 4.0.6 and it works. :)

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

[2001-11-09 18:17:30] [EMAIL PROTECTED]

Example script is also @  http://dev0.fidion.de/ssilk/test/err_array_merge.php

This behavior takes me now 2 hours... Perhaps it is fixed with 4.0.6? Sorry, no 
testing machine available.

<?php
$a=array(
    'ERROR' => array(
        'tags in text-text' => array(
            'err' => 'tags',
            'type'=> 'nachts'
        ),
        'range-ax-Erscheinungsdatum' => array(
            'err' => 'bla',
            'type' => 'blubb'
        )
    ),
    'WARN' => array(
        'ax-Anzeigenextra' => array(
            'err' => 'hugo',
            'type' => 'sex'
        )
    )
);

echo "<pre>";
echo "BUG:\n";
foreach ($a as $key => $val) {
    if ( empty($this->totalerrs[$key]) ) {
        $totalerrs[$key]=array();
    } 
    foreach ( $val as $k => $v) {
        print_r($v);
        $totalerrs[$key]=
                  array_merge($totalerrs[$key],$val);
    }
}

echo "\n\nFIX:\n";
foreach ($a as $key => $val) {
    if ( empty($this->totalerrs[$key]) ) {
        $totalerrs[$key]=array();
    } 
    $x=$val;
    foreach ( $val as $k => $v) {
        print_r($v);
        $totalerrs[$key]=
                  array_merge($totalerrs[$key],$x);
    }
}

?>

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



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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to