From:             [EMAIL PROTECTED]
Operating system: windows95
PHP version:      4.3.0
PHP Bug Type:     Reproducible crash
Bug description:  in_array not function as intended...

function a(){

        $fruit[0] = 'apple';
        $fruit[1] = 'orange';
        
        function aa(){
                global $fruit;
                
                (array) $fruit;
                echo in_array('apple', $fruit) ? 'ok' : 'fail';
        }
        
        function ab(){
                global $fruit;
                if(in_array('apple', array('apple', 'orange'))){
                        echo 'ok';
                } else {
                        echo 'fail';
                }
        }
}


a();
aa(); // echo fail and Warning: in_array() [function.in-array]: Wrong
datatype for second argument
ab(); // echo ok

/*
wondering ? bug : bogus;


May Allah bless all of us!.

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

Reply via email to