#22575 [Fbk-Opn]: Arguments passed to function changes!
ID: 22575 User updated by: public at hverdag dot dk Reported By: public at hverdag dot dk -Status: Feedback +Status: Open Bug Type: Session related Operating System: Windows 2000 PHP Version: 4.3.1 New Comment: That's a problem since it's a quite complex page divided into sections where you have to enter and submit 3-4 times before you come to the section where the error occurs. And when I just take those function calls out and put in a seperate page the problem never occurs! I call the function several times like this: $enterSQL .= field_to_sql('category', 'autovalue'); Then on the very first line within the function I echo the two values out to the browser and suddenly the first argument has the value 'autovalue' instead of 'category'! Couldn't that seem like a memory problem since it doesn't remember the values correctly? I don't understand how it can be session related - espacially when the values passed to the function are static - not variables! Previous Comments: [2003-03-09 17:49:32] [EMAIL PROTECTED] Please provide a full script (short!) that clearly demonstrates the problem and can be simply cut'n'pasted from this report. [2003-03-09 16:28:52] public at hverdag dot dk Enabling all error/warnings/notices only gives some undefined variables and indexes, and it's the same notices whether the page executes correct or not. So I cannot see any problem there. Talking about a session problem, how would that be? [2003-03-06 22:05:02] [EMAIL PROTECTED] It's most likely caused by sessions. Try adding 'error_reporting(E_ALL);' as first line in the script and see what errors you get. [2003-03-06 14:48:15] public at hverdag dot dk I have one function (see it below) where I pass 2 arguments. But sometimes (yes, only sometimes!) when inside the function myfield has the same value as myvalue instead of it's own value. In other words, it simply changes the values of the arguments! I have a long script where I at one point have a line like this several times to build up my SQL statement, calling this function: $enterSQL .= field_to_sql('category', 'autovalue'); But when I check the value of these two arguments inside the function both arguments have the value 'autovalue'! This happens inside my long script and it can happen usually two times (meaning: after a page reload) but the third time (second reload) the problem is gone and script executes as expected! And if I try to call this function from another simple page the problem never occurs. I'm using sessions but I cannot see how that should affect any of this (meaning, page reload should not affect anything). Here is the function (which is located in an included file in the above mentioned script): function field_to_sql($myfield, $myvalue) { echo br+. $myfield . +. $myvalue .+; #this outputs wrong value for the myfield variable! if ($myvalue == 'autovalue') { $myvalue_var_name = 'value_' . $myfield; global $$myvalue_var_name; if (!isset($$myvalue_var_name)) { echo 'Warning, variable is not set'; } $myvalue = $$myvalue_var_name; } $myvalue = str_replace(', \', $myvalue); if ($myvalue == '') { return `$myfield` = null, ; } else { return `$myfield` = '$myvalue', ; } } -- Edit this bug report at http://bugs.php.net/?id=22575edit=1
#22663 [NEW]: Variable $ID contains 3 initially
From: public at hverdag dot dk Operating system: Windows 2000 PHP version: 4.3.1 PHP Bug Type: Variables related Bug description: Variable $ID contains 3 initially Why on earth does the variable $ID contain the value 3 on a totally blank page where neither other script has been processed or session started???! This is not so big a problem in itself, but if I use $ID as a session variable it even overwrites this value - now, THIS is a problem! I cannot find any place where it says that one shouldn't use this variable name. -- Edit bug report at http://bugs.php.net/?id=22663edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22663r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22663r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22663r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22663r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22663r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=22663r=support Expected behavior: http://bugs.php.net/fix.php?id=22663r=notwrong Not enough info:http://bugs.php.net/fix.php?id=22663r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=22663r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22663r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22663r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22663r=dst IIS Stability: http://bugs.php.net/fix.php?id=22663r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=22663r=gnused
#22663 [Opn]: Variable $ID contains 3 initially
ID: 22663 User updated by: public at hverdag dot dk Reported By: public at hverdag dot dk Status: Open Bug Type: Variables related Operating System: Windows 2000 PHP Version: 4.3.1 New Comment: CORRECTION: I was NOT using $ID as a session variable though. But if I do it gives strange and totally off error messages about different places in my script where the script is perfectly correct. Previous Comments: [2003-03-12 13:09:01] public at hverdag dot dk Why on earth does the variable $ID contain the value 3 on a totally blank page where neither other script has been processed or session started???! This is not so big a problem in itself, but if I use $ID as a session variable it even overwrites this value - now, THIS is a problem! I cannot find any place where it says that one shouldn't use this variable name. -- Edit this bug report at http://bugs.php.net/?id=22663edit=1
#22575 [Fbk-Opn]: Arguments passed to function changes!
ID: 22575 User updated by: public at hverdag dot dk Reported By: public at hverdag dot dk -Status: Feedback +Status: Open -Bug Type: Session related +Bug Type: Variables related Operating System: Windows 2000 PHP Version: 4.3.1 New Comment: Enabling all error/warnings/notices only gives some undefined variables and indexes, and it's the same notices whether the page executes correct or not. So I cannot see any problem there. Talking about a session problem, how would that be? Previous Comments: [2003-03-06 22:05:02] [EMAIL PROTECTED] It's most likely caused by sessions. Try adding 'error_reporting(E_ALL);' as first line in the script and see what errors you get. [2003-03-06 14:48:15] public at hverdag dot dk I have one function (see it below) where I pass 2 arguments. But sometimes (yes, only sometimes!) when inside the function myfield has the same value as myvalue instead of it's own value. In other words, it simply changes the values of the arguments! I have a long script where I at one point have a line like this several times to build up my SQL statement, calling this function: $enterSQL .= field_to_sql('category', 'autovalue'); But when I check the value of these two arguments inside the function both arguments have the value 'autovalue'! This happens inside my long script and it can happen usually two times (meaning: after a page reload) but the third time (second reload) the problem is gone and script executes as expected! And if I try to call this function from another simple page the problem never occurs. I'm using sessions but I cannot see how that should affect any of this (meaning, page reload should not affect anything). Here is the function (which is located in an included file in the above mentioned script): function field_to_sql($myfield, $myvalue) { echo br+. $myfield . +. $myvalue .+; #this outputs wrong value for the myfield variable! if ($myvalue == 'autovalue') { $myvalue_var_name = 'value_' . $myfield; global $$myvalue_var_name; if (!isset($$myvalue_var_name)) { echo 'Warning, variable is not set'; } $myvalue = $$myvalue_var_name; } $myvalue = str_replace(', \', $myvalue); if ($myvalue == '') { return `$myfield` = null, ; } else { return `$myfield` = '$myvalue', ; } } -- Edit this bug report at http://bugs.php.net/?id=22575edit=1
#22575 [NEW]: Arguments passed to function changes!
From: public at hverdag dot dk Operating system: Windows 2000 PHP version: 4.3.1 PHP Bug Type: Variables related Bug description: Arguments passed to function changes! I have one function (see it below) where I pass 2 arguments. But sometimes (yes, only sometimes!) when inside the function myfield has the same value as myvalue instead of it's own value. In other words, it simply changes the values of the arguments! I have a long script where I at one point have a line like this several times to build up my SQL statement, calling this function: $enterSQL .= field_to_sql('category', 'autovalue'); But when I check the value of these two arguments inside the function both arguments have the value 'autovalue'! This happens inside my long script and it can happen usually two times (meaning: after a page reload) but the third time (second reload) the problem is gone and script executes as expected! And if I try to call this function from another simple page the problem never occurs. I'm using sessions but I cannot see how that should affect any of this (meaning, page reload should not affect anything). Here is the function (which is located in an included file in the above mentioned script): function field_to_sql($myfield, $myvalue) { echo br+. $myfield . +. $myvalue .+; #this outputs wrong value for the myfield variable! if ($myvalue == 'autovalue') { $myvalue_var_name = 'value_' . $myfield; global $$myvalue_var_name; if (!isset($$myvalue_var_name)) { echo 'Warning, variable is not set'; } $myvalue = $$myvalue_var_name; } $myvalue = str_replace(', \', $myvalue); if ($myvalue == '') { return `$myfield` = null, ; } else { return `$myfield` = '$myvalue', ; } } -- Edit bug report at http://bugs.php.net/?id=22575edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22575r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22575r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22575r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22575r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22575r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=22575r=support Expected behavior: http://bugs.php.net/fix.php?id=22575r=notwrong Not enough info:http://bugs.php.net/fix.php?id=22575r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=22575r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22575r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22575r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22575r=dst IIS Stability: http://bugs.php.net/fix.php?id=22575r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=22575r=gnused
#21495 [Com]: strlen, substr and so on bug
ID: 21495 Comment by: public at hverdag dot dk Reported By: roger4a45 at yahoo dot es Status: Bogus Bug Type: Strings related Operating System: windows 2000 server sp3 PHP Version: 4.2.3 New Comment: Excuse me roger4a45, but isn't that exactly what the problem is?! That it returns another output than expected?! It returns 0 where it SHOULD return something around 50! I probably have the same problem with strlen. When I use this: if (strlen($mydateformat) 4) ...and I _KNOW_ that $mydateformat is longer than 0, it often returns the length 0! But then when I reload the page the error doesn't occur again - usually only the first time I run this page in a new browser window! To me this really sounds like a bug... Previous Comments: [2003-01-07 12:26:55] roger4a45 at yahoo dot es A bug is when a function don't work properly... so, if I make strlen(HTML) i wait that output will be 6. if strlen produce another result is a bug. Ok. I will try to comment it to support forum. Thanks. [2003-01-07 12:22:30] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. [2003-01-07 12:17:59] roger4a45 at yahoo dot es whe we use strlen or substr there is a bug if parameter string is something like this: $a = HTMLHEADTITLEsomething/TITLE/HEADBODYhi!/BODYHTML; $b = strlen($a); echo $b; output is 0 rather real length of string Substr don't work right if we use same $a... any idea? Is use a PHP 4.2.3 (ZIP file) -- Edit this bug report at http://bugs.php.net/?id=21495edit=1