Don’t Copy Extra Variables in PHP

by Sanju 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;



Tagged in:

2785
like
0
dislike
0
mail
flag

You must LOGIN to add comments