Hello, using 7.2 version, Delphi 2007 + PHP 5.2, I discovered that an integer value passed as parameter to an extension is converted in 0 (zero). Here is the problem and the solution:
function TZendVariable.GetAsFloat: double;
begin
if not Assigned(FValue) then
begin
Result := 0;
Exit;
end;
case FValue^._type of
IS_STRING : Result := StrToFloatDef(GetAsString,0.0);
IS_DOUBLE : Result := FValue^.value.dval;
//Fabrizio 2011/12/13: integer values shoudl be accepted
IS_LONG : Result := FValue^.value.lval;
else
Result := 0;
end;
end;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, using 7.2 version, Delphi 2007 + PHP 5.2, I discovered that an integer value passed as parameter to an extension is converted in 0 (zero). Here is the problem and the solution:
function TZendVariable.GetAsFloat: double;
begin
if not Assigned(FValue) then
begin
Result := 0;
Exit;
end;
case FValue^._type of
IS_STRING : Result := StrToFloatDef(GetAsString,0.0);
IS_DOUBLE : Result := FValue^.value.dval;
//Fabrizio 2011/12/13: integer values shoudl be accepted
IS_LONG : Result := FValue^.value.lval;
else
Result := 0;
end;
end;