Design issue Integer option values return as string

Jake B.

Well-known member
Affected version
2.0.5
For example, if I try to dump out the reportIntoForumId value with this:

PHP:
\XF::dump([
    \XF::options()->reportIntoForumId,
]);die;

the selected forum ID will return as a string rather than an integer

Screen Shot 2018-05-02 at 1.29.02 PM.webp

which is a bit annoying in certain circumstances
 
Unfortunately, this is unavoidable for the most part because the entity column type has to support multiple value types. It's a BINARY field so scalar values are typically converted to a string when they're saved into the option cache.

It's just something you'll have to account for in your code, unfortunately.
 
Top Bottom