ID: 32584
Updated by: [EMAIL PROTECTED]
Reported By: xsmokex at chello dot at
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: Windows 2003 Server
PHP Version: 5.0.3
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-04-05 10:51:56] xsmokex at chello dot at
Description:
------------
count just stops returning any values inside my function
outside it returns the value it should quite dissapointing bug :/
Reproduce code:
---------------
$idxsplit = "kunden___Kunden_Nr,kunden___Zuname";
$idx = explode(",",$idxsplit); //Index Felder
$idxcnt = count($idx);
echo $idxcnt;
//Aktives Feld Index Feld?
function isidx($obj) {
echo $obj;
$retval = 0;
if ($obj != "") {
echo "obj";
echo $idxcnt;
echo "test";
for ($i = 0; $i < $idxcnt; $i++) {
echo $idx[$i];
if ($idx[$i] == $obj) {
$retval = 1;
break;
}
}
}
echo $idxcnt;
echo "ende".$retval;
return $retval;
}
//Erster Satz
if ($kunden___speichern == "mer") {
if (isidx($kunden___AKTFLD)) { //kunden___Kunden_Nr/kunden___Zuname
Expected result:
----------------
well runing isidx() with $kunden___AKTFLD(value:kunden___Kunden_Nr or
kunden___Zuname ....)
returning true/false if the current selected field is a indexed field
Actual result:
--------------
the echo returnings:
2kunden___Kunden_Nrobjtestende0
Broken down:
outside function:
2: echo $idxcnt;
inside function:
kunden___Kunden: echo $obj;
obj: echo "obj";
: echo $idxcnt; //no value returned
test echo "test";
: echo $idx[$i]; //dont get into due no value from
$idxcnt
: echo $idxcnt; //no value returned
ende0 echo "ende".$retval;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32584&edit=1