shang2010 发表于 2012-06-28 16:19

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

hbeimf 发表于 2012-06-29 18:22

:em17::em17::em17::em17::em17:

shang2010 发表于 2012-06-30 19:54

java是不支持goto的,:mrgreen:

maochanglu 发表于 2012-07-02 09:48

无语了,这个真心不希望使用goto
页: [1]
查看完整版本: php开明 5.3支持goto语句