Reading the Google Developers PHP performance tips I saw that it isn\'t recommended to make an extra copy of a varible.
Instead of this:
$description
PHP's "lazy copy" only applies to arrays. The array's data is only duplicated if one copy of the array is changed, which is why it's okay for the foreach loop to work on a copy of the original array, for instance.
Objects are passed by reference, even when not told to do so with &. Example:
$a = new StdClass();
$b = $a;
$b->derp = "foo";
var_dump($a->derp); // "foo"
Resources are references to a resource to be used by a particular extension, so they can't meaningfully be copied.
Everything else is copied directly.
Unnecessary variables should be avoided anyway. For instance, instead of:
$step1 = 123;
$step2 = $step1 * 4;
$step3 = $step2 + 99;
$step4 = $step3 / 3;
echo $step4;
You could just write:
echo (123*4+99)/3;
(or, in this case, just echo 197;)
The point is, unnexessary variables do create clutter and could potentially conflict with a variable you defined elsewhere.