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

PHP Fatal error: 'continue' not in the 'loop' or 'switch' context #89

Closed
alexhass opened this issue Jul 4, 2016 · 5 comments
Closed

Comments

@alexhass
Copy link

alexhass commented Jul 4, 2016

PHP 7 compatibility checks are not working well, see https://www.drupal.org/node/2760025

[Sun Jul 03 22:59:57.311158 2016] [:error] [pid 3168:tid 1844] [client ::1:54149] PHP Fatal error: 'continue' not in the 'loop' or 'switch' context in httprl\httprl.module on line 1418

Drupal 7 code can be found at https://www.drupal.org/project/httprl.

@sstalle
Copy link
Owner

sstalle commented Jul 4, 2016

Thank you for your report, @yamlfd. It would help a lot if you could provide the exact code you are running, because I don't see any continue statements on line 1418 of the most recent development release of httprl.module from https://www.drupal.org/project/httprl

@alexhass
Copy link
Author

alexhass commented Jul 4, 2016

See http://cgit.drupalcode.org/httprl/tree/httprl.module?h=7.x-1.x

I have tested against the latest release, but this is dev and it is full of continue's.

@sstalle
Copy link
Owner

sstalle commented Jul 6, 2016

Check for continue outside loop was added to the master branch. I tried running it against the http://cgit.drupalcode.org/httprl/tree/httprl.module?h=7.x-1.x, but it did not produce any warnings. I also tried native PHP syntax checking:

$ php -v
PHP 7.0.10-dev (cli) (built: Jul  5 2016 17:02:11) ( NTS DEBUG )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.10-dev, Copyright (c) 1999-2016, by Zend Technologies
$ php -l httprl.module
No syntax errors detected in httprl.module

Please feel free to reopen if you can provide a failing test case.

@alexhass
Copy link
Author

alexhass commented Jul 6, 2016

I tried your PHP 7 Compatibility Checker version 1.1.0 agains the last release https://ftp.drupal.org/files/projects/httprl-7.x-1.14.zip and it complained.

@alexhass
Copy link
Author

alexhass commented Jul 6, 2016

Ah, sorry - confusend myself... your checker does NOT complain. That is the bug. PHP itself complains if it includes the httprl module in Drupal.

php -l httprl.module
No syntax errors detected in httprl.module

This also gives me no info, but if the module is enabled in Drupal - PHP stops with an exception.

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