bugphpGroupWare - Bugs: bug #3689, Wrong usage of datatypes in the...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #3689: Wrong usage of datatypes in the whole api

Submitted by:  Kai Hofmann <powerstat>
Submitted on:  Mon 19 May 2003 10:53:35 AM UTC  
 
Item Group: NoneCategory: None
Severity: 3 - NormalPriority: 5 - Normal
Status: InvalidPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: NoneOperating System: None
Reproducibility: NonePlanned Release: None
Fixed Release: 

Thu 26 Jun 2003 10:33:07 PM UTC, comment #1:

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
}

Dave Hall <skwashd>
Project Administrator
Mon 19 May 2003 10:53:35 AM UTC, 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!

Kai Hofmann <powerstat>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 26 Jun 2003 10:33:07 PM UTCskwashdStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1