Performance: condition testing vs assignment
问题 I've created a loop where a variable is used to test if the current run-through of the loop is the first one. Its fairly simple: $firstrun = true; while(condition){ if($firstrun) // Do this else // Do that // Change $firstrun to false } I was just wondering (mostly out of curiosity because I'm it makes no real noticeable difference), when I need to change $firstrun to false, would be more efficient to test if the variable is true before assigning it to false or simply reassign it to false