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

Parse error with "yield" above PHP 5.5 #110

Open
coevolving opened this issue Dec 29, 2016 · 0 comments
Open

Parse error with "yield" above PHP 5.5 #110

coevolving opened this issue Dec 29, 2016 · 0 comments

Comments

@coevolving
Copy link

coevolving commented Dec 29, 2016

This problem would seem to be relevant to the code version 1.0 dated 27 Jul 2011, for a problem I've fixed on Version 0.99.9.6 . I reported this at https://wordpress.org/support/topic/parse-error-with-yield-above-php-5-5/ , and reproduce it here for anyone who wants to do the update.

I recently migrated my blog from a host where PHP 5.5 was used, to a new host where PHP 5.6 is the default. I've stayed on Version 0.99.9.6 due to formatting changes that happened, subsequently.

On attempting to activate Version 0.99.9.6, I got an error:

Parse error: syntax error, unexpected 'yield' (T_YIELD), expecting identifier (T_STRING) in /home/PRIMARYDOMAIN/ADDONDOMAIN/blog/wp-content/plugins/lifestream/inc/core.php on line 2579

Searching on this error discovered two similar problems:

yield() method conflicts with PHP 5.5+ "yield" keyword at [(https://github.com/lonnieezell/Ocular-Template-Library/issues/23)] ; and

the used yield is a resereved keyword in PHP 5.5 at [(https://github.com/tractorcow/silverstripe-dynamiccache/issues/19)] .

Following through on the fix (on silverstrip-dynamiccache), the function yield was renamed to yieldControl.

In Lifestream inc/core/php, there are four instances of the function "yield", that I replaced with yieldControl. (There are also two instances of yield_many, which I've left alone).

Uploading and reactivating, I got and error message:

Parse error: syntax error, unexpected 'yield' (T_YIELD), expecting identifier (T_STRING) in /home/PRIMARYDOMAIN/ADDONDOMAIN/blog/wp-content/plugins/lifestream/extensions/amazon/extension.inc.php on line 11

So, it seems as though this error occurs in many of the the extension.inc.php files within the extensions directory. Making the change (including in many extensions for dead web sites) revived the plugin.

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

1 participant