Support » Plugin: Lifestream » Parse error with “yield” above PHP 5.5

  • 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.

  • The topic ‘Parse error with “yield” above PHP 5.5’ is closed to new replies.