Fabrizio Vita - 2011-12-13

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;