[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-tracker] [bug #3689] Wrong usage of datatypes in the whol
From: |
nobody |
Subject: |
[Phpgroupware-tracker] [bug #3689] Wrong usage of datatypes in the whole api |
Date: |
Thu, 26 Jun 2003 18:33:08 -0400 |
User-agent: |
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3.1) Gecko/20030425 |
=================== BUG #3689: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3689&group_id=509
Changes by: Dave Hall <address@hidden>
Date: Fri 06/27/2003 at 08:33 (Australia/Melbourne)
What | Removed | Added
---------------------------------------------------------------------------
Resolution | None | Invalid
Status | Open | Closed
------------------ Additional Follow-up Comments ----------------------------
Generally we only @ error supression for arrays, when we can not be sure the
key/val pair exists. Return type are flexible in php, and so we take advatnage
of that. Most apps will use
if($loose_typed)
{
//must be a string so do something
}
else
{
//must be false so do something else
}
=================== BUG #3689: FULL BUG SNAPSHOT ===================
Submitted by: powerstat Project: phpGroupWare
Submitted on: Mon 05/19/2003 at 20:53
Category: None Bug Group: None
Severity: 5 - Major Priority: None
Resolution: Invalid Assigned to: None
Status: Closed Component Version: None
Platform Version: None Reproducibility: None
Summary: Wrong usage of datatypes in the whole api
Original Submission: variables, method parameters and return values are not
used
correctly depending on datatypes.
Example:
function read_repositories($cached='',$write_cache=True)
{
[..}
if(@$cached)
[..]
}
cached is not used anywhere else - so it should be boolean -
this would also remove the @ for suppressing the type cast warning!
Another ba dthing I found are return values
something like:
if (xyz)
return $string;
else
return false
there are many more bad things regarding datatype usage.
With respect to php 5 this should be fixed for future compatibility!
Follow-up Comments
*******************
-------------------------------------------------------
Date: Fri 06/27/2003 at 08:33 By: skwashd
Generally we only @ error supression for arrays, when we can not be sure the
key/val pair exists. Return type are flexible in php, and so we take advatnage
of that. Most apps will use
if($loose_typed)
{
//must be a string so do something
}
else
{
//must be false so do something else
}
CC list is empty
No files currently attached
For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3689&group_id=509
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-tracker] [bug #3689] Wrong usage of datatypes in the whole api,
nobody <=