davidshq Posted August 8, 2017 Share Posted August 8, 2017 Hi Folks, I'm looking at a snippet of PHP code that looks like this: while ($this->update_table_structure()) { $this->update_table_structure(); } I'm confused as to what this achieves? It sounds to me like it is saying: while we are updating the table structure keep on updating the table structure? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 8, 2017 Share Posted August 8, 2017 Yeah, that looks pretty stupid. Seems like you could accomplish the same thing with this: while ($this->update_table_structure()); You don't need a body of the loop at all. Also a question is why "update table structure" needs to be called multiple times sequentially instead of just once. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now