What's better at freeing memory w...
What's better at freeing memory w...
Here's a concise answer to your PHP interview question:
In PHP, both unset() and assigning null to a variable can be used to free up memory occupied by a variable. However, there are some differences in their behavior and implications:
unset() functionunset() function completely removes the variable from memory and the symbol table.unset() on a variable makes it unavailable for further use until it is reassigned a value.unset() can be used to remove multiple variables at once by passing them as arguments separated by commas.null to a variablenull to a variable sets its value to the null constant, which represents a variable with no valu...senior