What are some best practices for optimizing PHP scripts for faster performance?

Issue: One way to optimize PHP scripts for faster performance is to minimize the use of unnecessary functions and loops. This can help reduce the overall execution time of the script and improve its efficiency. Code snippet:

// Before optimization
for ($i = 0; $i < 1000; $i++) {
    echo $i;
}

// After optimization
for ($i = 0; $i < 1000; $i += 10) {
    echo $i;
}