Declares a variable inside a call to a bad practice method?
Yes, because it hides the intent of other functions.
$file = "skins/Default/Controllers/Demo.php";
if (file_exists($file)) {
require($file);
}
easier to read and reason than:
if (file_exists($file = "skins/Default/Controllers/Demo.php")) {
require($file);
}
because it would be easily mistaken for $file == "skins/Default/Controllers/Demo.php"what is usually found in the instructions if.
source
share