From:             pieter3d at hotmail dot com
Operating system: WinXP
PHP version:      4.3.1
PHP Bug Type:     Arrays related
Bug description:  array_diff works differently than expected

When executing this code:

        $a = array(1,2,3,4,5,6,7,8,9);
        $b = array(3,4,5);
        $test=array_diff($a,$b);
        $i=0;
        while($test[$i])
        {
                echo "$test[$i]<br>";
                $i++;
        }

the result is:
1
2

The expected result of course is
1
2
6
7
8
9

-- 
Edit bug report at http://bugs.php.net/?id=22863&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22863&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22863&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22863&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22863&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22863&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22863&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22863&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22863&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22863&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22863&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22863&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22863&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22863&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22863&r=gnused

Reply via email to