php开明 5.3支持goto语句
goto(PHP 5 >= 5.3.0)
The goto operator can be used to jump to another section in the program. The target point is specified by a label followed by a colon, and the instruction is given as goto followed by the desired target label. This is not a full unrestricted goto. The target label must be within the same file and context, meaning that you cannot jump out of a function or method, nor can you jump into one. You also cannot jump into any sort of loop or switch structure. You may jump out of these, and a common use is to use a goto in place of a multi-level break.
为了写复杂的业务逻辑,有时候就是需要多级跳出multi-level break
http://php.net/manual/en/control-structures.goto.php :em17::em17::em17::em17::em17: java是不支持goto的,:mrgreen: 无语了,这个真心不希望使用goto
页:
[1]