"Goto" deyimi düz ASM ya da diğer herhangi bir assembler dilinde çıkıyor.
İşte link: http://be2.php.net/manual/en/control-structures.goto.php
I'm wondering: what can this do to make my code more well-organized? How can I implement this in larger projects, without screwing it up. Since the goto will allow you to jump back and forth, accidental assignments and infinite loops are waiting to happen if you use this the wrong way.
Birisi bana bu bir iyi kullanmak bir örnek verebilir misiniz?
EDIT: tamam, ben cevapların bazılarını gördüm ve görünüşe göre geniş bir konsensüs "goto" ifadesinin kullanımı hakkında var ve kötü olmak.
Yani ben hala merak ediyorum: Neden PHP dili eklemek için rahatsız olur. Onlar bir şey görmedim, onlar bunu ... neden olmasın ki?
Ayrıca: A discussion here on StackOverflow about "goto" in general
EDIT2: Bu soru Goto deyimi hakkında üzgün olmak için kötü bir çok şey kaynaklı olarak gören, ben gittim ve babama sordum. O 52 yaşında ve bir Endüstri Mühendisi. Kendisinin gün içinde ve çoğunlukla FORTRAN ve COBOL programlama iyi bir miktar yaptım bana bir kaç kez söyledim /> Anyways, he said some stuff about "back in my day..." Ve bu şekilde, yavaş yavaş kodunuzu ayıklanmış. O modern programlama dünyada goto kullanımı oldukça yararsız olduğunu kabul eder. O haklı bulduğu tek kullanım aşırı hata ayıklama ve beklenmedik durumlarda kullanılmak üzere bir "acil durum break", olduğunu. Kinda GEÇ DÜZENLEME: Another discussion about "goto" in PHP5.3/PHP6
After discussing that a bit, he came back to the goto statement, saying that even back in his days as a student, they allready knew it wasn't a smart idea to use it, but they didn't have much better back then. Try/catch was still years away and error handling hardly excisted.
So what did you do to check your program? Add a few lines at the end that allow you to print output and everything you need to check in your code, and then you place the line: "goto printing;", or something like that, to start the printing of your data.goto fatal_error;
gibi, ve kod "fatal_error" kısmını derinlemesine sonuçları göstermek için bazı şeyler var.
Ama sadece bir şey oluşturulması sırasında. Bir mamul Goto-ifadeler olmamalıdır.