Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in .../vendor/mjaschen/phpgeo/src/Location/Coordinate.php on line 73 #43

Closed
gonzalesc opened this issue Jan 2, 2019 · 1 comment

Comments

@gonzalesc
Copy link

Hi.
I had PHP 7.0 and it show a error:

mod_fcgid: stderr: PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in .../vendor/mjaschen/phpgeo/src/Location/Coordinate.php on line 73,

Then I updated it to PHP 7.2 and the error disappeared.

Regards

@mjaschen
Copy link
Owner

mjaschen commented Jan 2, 2019

Hi,

are you sure, you were running PHP 7.0? The described error indicates that a PHP version less than 7 was running.

e.g. when using 5.6.38:

% php-5.6.38 -l src/Location/Coordinate.php                                                                                                                                                                             PHP Warning:  Unsupported declare 'strict_types' in src/Location/Coordinate.php on line 2

Warning: Unsupported declare 'strict_types' in src/Location/Coordinate.php on line 2
PHP Parse error:  syntax error, unexpected ':', expecting ';' or '{' in src/Location/Coordinate.php on line 73

Parse error: syntax error, unexpected ':', expecting ';' or '{' in src/Location/Coordinate.php on line 73
Errors parsing src/Location/Coordinate.php

Linting the file with PHP 7.0.33 shows no error:

% php-7.0.33 -l src/Location/Coordinate.php
No syntax errors detected in src/Location/Coordinate.php

@mjaschen mjaschen closed this as completed Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants