Exactly why does this happen? PHP 8.1.
This is the function:
It works if $_REQUEST['var2'] is defined, if not I get this error:
Why? If $_REQUEST['var2'] is null shouldn't it be equal to 0 within the function? If I force $_REQUEST['var2'] = 0 it works fine.
Sometimes $_REQUEST['var2'] is undefined. Its null I guess.$whatever = funcSomeFunction($aFinalArrayWP, $aFinalArrayEP, $_REQUEST['var1'], $_REQUEST['var2']);
This is the function:
function funcSomeFunction($aFinalArrayWP = "", $aFinalArrayEP = "", $iVar1 = 1, $iVar2 = 0) { ... }
It works if $_REQUEST['var2'] is defined, if not I get this error:
PHP Fatal error: Uncaught TypeError: Unsupported operand types: string + string in...
...page-results.php(33): funcSomeFunction(Array, Array, '1', '')
Why? If $_REQUEST['var2'] is null shouldn't it be equal to 0 within the function? If I force $_REQUEST['var2'] = 0 it works fine.