I am trying to clarify the difference between $stmt->close() and $stmt->free_result() when finalizing a prepared mysqli st
PHP will end your connection and free the resource after it finishes running;
mysqli::close Closes a prepared statement.
Since the number of total connections available is limited, freeing the resource the second you're done with it is a good practice.
And
mysqli_stmt::free_result Frees stored result memory for the given statement handle.
it's good practice to free explicitly the resource when you don't need them anymore. it might avoid make a heavy load into the server when many requests are made at the same time.
Both aren't never strictly necessary to invoke, and is a good practice the use of both.