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 Version 5.3.8 - Parse error: syntax error, unexpected '[' #58

Closed
zirnipa opened this issue Jun 23, 2017 · 3 comments
Closed

PHP Version 5.3.8 - Parse error: syntax error, unexpected '[' #58

zirnipa opened this issue Jun 23, 2017 · 3 comments

Comments

@zirnipa
Copy link

zirnipa commented Jun 23, 2017

Tested our SDK with PHP Version 5.3.8:
It looks like this PHP version does not support the used array declaration

public function token($paymentType, array $additional = [])
public function createTokenPayment($pType, array $additional = [])
public function acceptPayment($type, $tid, $payment = [], $additional = [])

Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\sdk\src\Mpay24.php on line 189

I think we should only support the supported versions: http://php.net/supported-versions.php

@stefanpolzer
Copy link
Contributor

stefanpolzer commented Jun 23, 2017

You right this annotation is only supported in PHP 5.4+.... I also agree that only the new PHP Version should be supported, this old PHP versions are also a kind of security risk.
PHP 5.3 is EOL since 14 Aug 2014 and I assume that now one that use mpay24-php 4.0.0+ is using this old PHP version otherwise there would be a lot of complains already.

@chesio
Copy link
Contributor

chesio commented Nov 15, 2018

The SDK as it is requires PHP 5.6 at least, see: https://github.com/mpay24/mpay24-php/blob/master/src/Mpay24Confirmation.php#L42-L61

const CONFIRMATION_PROPERTIES = [
    'OPERATION'      => 'CONFIRMATION',
    'TID'            => '.{0,32}',
    ...

From PHP manual:

As of PHP 5.6 it is possible to define array constant using const keywords [...]

@stefanpolzer
Copy link
Contributor

@zirnipa I assume this on is now obsolete or do we need a fix on the older version 4.x for PHP 5.3.8?

@zirnipa zirnipa closed this as completed Feb 6, 2020
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

Successfully merging a pull request may close this issue.

3 participants