http://www.faressoft.org/test/hello.php
My Code :
<?php
echo "hello World";
goto end; // this is line 3
echo "before end";
end:
echo "end";
?>
Error : Parse error: syntax error, unexpected T_STRING in /home/alfalah1/public_html/faressoft.org/test/hello.php on line 3
It works very well in my localhost but doesn't work in justhost server ? why ?
but doesn't work in justhost server ? why ?
Probably because the remote server isn't running PHP 5.3, which is the minimum required version for goto.
That said, using the goto keyword is generally regarded as an awfully, awfully bad practice from the olden days. I still think this got introduced in PHP because of a lost bet or something. I would not get into the habit of using it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With