Reputation: 4369
function goto($herf) {
echo ("<script>window.location.href='".$herf."'</script>");
}
the above function work well before php 5.3.5, after i upgrade my php to 5.3.5, the following error displayed.
Parse error: syntax error, unexpected T_GOTO, expecting T_STRING or '(' in C:\xampp\htdocs\directory\directory\directory\directory\file.php on line 9
what is that error refer?
Upvotes: 0
Views: 576
Reputation: 22542
They added goto to the php language, which makes it a reserved word and no longer available as a function name.
The goto operator is available as of PHP 5.3.
Upvotes: 8
Reputation: 3715
So solution is:
function location($herf) {
echo ("<script>window.location.href='".$herf."'</script>");
}
Upvotes: 2