Assuming the following:
$user = new User;
$user->setOption( 'someoption' );
$user->getOption( 'someotheroption' );
the getOption will return null even though it is set in default options. When calling
$user->getOption( 'someotheroption' );
$user->setOption( 'someoption' );
instead, it will work perfectly fine.
This is because User::getOption() will check whether User::mOptions is set to null and in this case get the default options. It is not null anymore after setOption() though.
Therefore, the default options should be loaded in the constructor I guess. Might be that this is more expensive though. There could be a more complex solution to this, perhaps checking in setOption() whether options are null and then setting some internal member to check against in getOption()
Version: 1.20.x
Severity: normal