$changedDir = preg_replace('|wp-content.*$|','',__FILE__);
Is it same asThe first line and the if statement is useless there. $changedDir is empty and if statement would always turn to true since $changedDir is empty.
$changedDir='';
if (!$changedDir)
{
$changedDir = preg_replace('|wp-content.*$|','',__FILE__);
}
Is it same as
Code:$changedDir=''; if (!$changedDir) { $changedDir = preg_replace('|wp-content.*$|','',__FILE__); }
PHP is whitespace insensitive, so there could be space or not even. Even in C#, that kind of statement would compile fine. Casting couldn't be done to variable names, you need to specify the type to cast to in that caseIs it same as
I'm confused why there isn't empty space between if (!$ChangedDir)$changedDir?Code:$changedDir=''; if (!$changedDir) { $changedDir = preg_replace('|wp-content.*$|','',__FILE__); }
It doesn't have to be?
I thought it was some kind of casting like in c#