Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Now that I come to think of it, it actually doesn't matter for PHP.

While loops limit the scope of variables inside the loop. For C++, that means a variable declared inside cannot be used outside - logical, and OOP.

But PHP has no concept of privacy or scope, even its "rules" may be broken (though not guaranteed to always work) and come out with the right results. Anything will compile, and usually the results are as expected.

So if you have a while loop with no concept of scope or local variables, I guess the restrictions are gone. A number of nested loops with breaks; and continues; all over end so long as the concept of limited data scope/access is not present as in PHP are exactly equivalent to goto as it is.

I guess a language as, shall we say, 'relaxed' as PHP is well-matched with relaxed keywords like goto.



No, thats not what he means. He means that gotos are unstructured, and you can do anything with them, like jumping into a loop.

Although, PHP's gotos don't allow they, and PHP still only admits structured control flow.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: