代码之家  ›  专栏  ›  技术社区  ›  faressoft

goto出现“语法错误,意外T_字符串”问题[已关闭]

  •  3
  • faressoft  · 技术社区  · 15 年前

    http://www.faressoft.org/test/hello.php

    我的代码:

    <?php
    echo "hello World";
    goto end; // this is line 3
    echo "before end";
    end:
    echo "end";
    ?>
    

    错误:

    它在我的本地主机上工作得很好,但在justhost服务器上不工作?为什么?

    1 回复  |  直到 15 年前
        1
  •  9
  •   Pekka    15 年前

    但在justhost服务器中不工作吗?为什么?

    可能是因为远程服务器没有运行PHP 5.3,即 minimum required version goto .

    也就是说,使用 转到