|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-05-01 17:20 UTC] claudio dot frizziero at nereal dot com
Hello!
i might have found a problem dealing with 0 and NULL values while using a recursive function in a class that i have created.
I have found some bugs related to this problem in the php-bugs database about "0" and "NULL", but the problem i have found goes more into depth: i've noticed that 0 == NULL only if the value "0" only if the value "0" comes from the array passed to the recurvise function. i try to explain with an example:
$temp = $a[$p];
if ($temp == "") {
if ($temp == "0") {
echo ("impossible");
}
}
it happens that the output will be "impossible".
instead, if i set $temp = "0" or NULL before the IF structures, i won't get the output "impossible":
$temp = $a[$p];
$temp = "0";
// or $temp = NULL;
// or without declaring at all the variable $temp
if ($temp == "") {
if ($temp == "0") {
echo ("Impossible");
}
}
$a is an array which can be modified or not by the recursive function, and is then passed as a parameter to the function itself
I have tested it both with version 4.0.5 and 4.2.0
If you would like to receive more details about this, i will be glad to send you the complete source code. i have tried to reduce the lenght of the code, anyway it's still too long to write here. if you are interested, i could send you all the code by email or i could give you an account to access my server and work by ftp/http
best regards,
and thank you for developing PHP :)
Claudo Frizziero
---
configure line:
configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --with-jpeg-dir=/usr/local/bin --with-gd=/usr/ --enable-ftp
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
Already exists, try if (NULL !== 0) { ... } else { ... } bogussing. Derick