In Php if I write something like
If ($this->that()){ return $this->that()}
Does it execute $this->that() twice? Or does that parser figure it out and reduce it to 1 call?
Trying to keep code clean if possible, but don’t want to double by execution time for sake of one variable assignment.
Yes, it executes twice.
To make it execute once, you should save it’s value into a variable and return the variable: