Don’t Copy Extra Variables in PHP
by Sanju[ Edit ] 2012-06-18 13:19:18
Don’t Copy Extra Variables in PHP
Some people like to try and make their code more appealing by copying predefined variables to smaller-named variables. This is redundant and could potentially double the memory of your script.
Google Code has bad and good examples of variable usage:
Good:
echo strip_tags($_POST['name']);
Bad :
$name = strip_tags($_POST['name']);
echo $name;