php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35151 True/false bug
Submitted: 2005-11-08 12:09 UTC Modified: 2005-11-08 12:10 UTC
From: antido at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.0.5 OS: Windows XP
Private report: No CVE-ID: None
 [2005-11-08 12:09 UTC] antido at gmail dot com
Description:
------------
I encountered this bug while reading out a CSV file.
The problem here is the fact that PHP cannot parse True/False as a string in this situation.
In the CSV file, rows are built like this:
"True";"26631";"2";"6";"20040521";"2004";"null"

When I loop through the rows, and echo the first value ($data[0]) it says "True" or "False", but when I try to use it in an if-statement, it will always go to the else section.

Reproduce code:
---------------
function convertBoolean($tring)
{

	if($tring == 0)
	{
		$return = "1";
	}
	else 
	{
		$return = "0";
	}
		
	return $return;
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-08 12:10 UTC] tony2001@php.net
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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Sep 03 18:00:01 2026 UTC