From: [EMAIL PROTECTED]
Operating system: win2k
PHP version: 4.2.2
PHP Bug Type: Arrays related
Bug description: function array_search return zero instead of false!
I try to find some entry in an Array beginning with
index 0. I test for false to treat the "not found" event
but don�t find my entrys in the first line.
If i test for 0 i always end up with my fist line.
$this->wochentage_name=array(
array(0,"Monday","Montag","Mo"),
array(1,"Tuesday","Dienstag","Di"),
array(2,"Wednesday","Mittwoch","Mi"),
array(3,"Thursday","Donnerstag","Do"),
array(4,"Friday","Freitag","Fr"),
array(5,"Saturday","Samstag","Sa"),
array(6,"Sunday","Sonntag","So")
);
for($i=0;$i<sizeof($this->wochentage_name);$i++)
{
print_r($this->wochentage_name[$i]);
echo "ENDE f�r Nummer".$i."<br>";
$key = array_search($in,$this->wochentage_name[$i]);
if($key != 0)
{
return $this->wochentage_name[$i][$row];
}
}
--
Edit bug report at http://bugs.php.net/?id=20645&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20645&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20645&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20645&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20645&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20645&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20645&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20645&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20645&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20645&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20645&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20645&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20645&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20645&r=isapi