My question is about to make some laugh but I like keeping things clean and clear when I code, here's my question 'what is the best between both the chunks ?' :
$placeholders['createtime'] = is_null($Article->get_createtime())
? 'NOW()'
: $Article->get_createtime();
or
$createTime = $Article->get_createtime();
$placeholders['createtime'] = is_null($createTime) ? 'NOW()' : $createTime;
I would tend to say the second one is better regarding procedural performances but as I barely know about how php manages variables into memory and functions' calls I decided to ask.
I know it also depends on the complexity of the function get_createtime()
and if the function is long to process it is better to store the result in the memory, but my question stars basic getters with just a return instruction inside.