• Resolved code.sport

    (@codesport)


    Hi,

    while commiting to SVN I got following error:

    Error: ***********************************  
    Error: PHP error in:  
    Error:  course-booking-system-extension/trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php:  
    Error:   
    Error:   
    Error: Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in  
    Error:  Standard input code on line 15  
    Error: Errors parsing Standard input code  
    Error: ***********************************  
    Error: This error was generated by a custom hook script on the Subversion server.  
    Error: Please contact your server administrator for help with resolving this issue.  
    

    On the mentioned file I can fin following code:

    if (!function_exists('mb_convert_encoding')) {
        function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); }
    }

    This is a union which is supportend since PHP 8.0. How can I push this file?

    • This topic was modified 2 years, 10 months ago by Jan Dembowski. Reason: Moved to Everything else WordPress, this is not an Developing with WordPress topic
    • This topic was modified 2 years, 10 months ago by Jan Dembowski.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Code must be back-compatible to 7.4
    https://www.ads-software.com/about/requirements/

    Thread Starter code.sport

    (@codesport)

    Thanks.

    My code is compatible with 7.4. This code section which makes this troubles is from symfony. In bootstrap.php is on line 14 to 16 following statement:

    
    if (\PHP_VERSION_ID >= 80000) {
        return require __DIR__.'/bootstrap80.php';
    }
    

    Which calls the bootstrap80.php which contains the mentioned method.

    I don’t want to change the library before publishing. What hint do you have for me that I can do the release?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Nothing, unfortunately. The commit process checks each PHP file individually. That file is not backwards compatible. It doesn’t matter that the file is not included in older versions of PHP, the file is checked on its own.

    Use an older version of the library that doesn’t have that file in it. Or wait until www.ads-software.com runs PHP 8.

    I just encountered a similar problem.
    From the requirements I read PHP 7.4 or greater. PHP 8 is obviously greater.
    I also looked at this post and it recommends plugin authors to be PHP8 compatible:

    WordPress and PHP 8.0

    Is there a date, when PHP 8 can be committed in plugins/themes?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin SVN checkin throws error on file bootstrap80.php’ is closed to new replies.