"Syntax error, unexpected T_STRING error" with goto

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

My code is:

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

Error: Analysis error: syntax error, unexpected T_STRING in / home / alfalah 1 / public_html / faressoft.org / test / hello.php on line 3

It works fine in my localhost, but doesn't work on justhost server? why?

+3
source share
1 answer

but not working on justhost server? What for?

Probably because PHP 5.3 is not running on the remote server, which is the minimum required version for goto.

, goto , . , PHP - - . .

+9

Source: https://habr.com/ru/post/1773840/


All Articles