1024programmer Java PHP error syntaxerror, unexpectedT_GOTO, expectingT_STRING, the error file and line number point to the above code, what is the reason?

PHP error syntaxerror, unexpectedT_GOTO, expectingT_STRING, the error file and line number point to the above code, what is the reason?

PHP reports syntax error, unexpected T_GOTO, expecting T_STRING. The error file and line number point to the following code. What is the reason?
The local PHP version is 5.3.8, Apache/2.2.21. I guess it is an environmental problem, because It was running normally, but this problem occurred when I put it on another computer
How to solve it? Sad!

public function goto($url, $msg=NULL) {
if ($msg) {
$this->jsAlert($msg);
}
$this->js(‘document.location=”‘ . $url . ‘”;’);
$this->output(true);
exit;
}

——Solution——————–
Starting from php5.3, PHP has restored the goto instruction that has been abandoned by structured programming for many years
Now that goto has been upgraded to a reserved word, you cannot use it as a function (method) name

goto operator can be used to jump to a specified location in the program. The target location can be marked with the target name followed by a colon. Goto in PHP has certain restrictions and can only jump within the same file and scope. This means that you cannot jump out of a function or class method, nor can you jump into another function. You also cannot jump into any loops or switch structures. Common usage is to break out of a loop or switch, which can replace multiple levels of break.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/790138

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索