globalpayments / php-sdk

GNU General Public License v2.0
49 stars 66 forks source link

Bug: Syntax Error, Unexpected '?' #27

Closed mike-brookes closed 2 years ago

mike-brookes commented 5 years ago

PHP 5.6 Bug in: globalpayments/php-sdk/src/Gateways/Gp3DSProvider.php in multiple locations...

example:

$request['payer'] = $this->maybeSetKey($request['payer'], 'email', $builder->getCustomerEmail() ?? null);

Should be I guess :

$request['payer'] = $this->maybeSetKey($request['payer'], 'email', $builder->getCustomerEmail() ? $builder->getCustomerEmail() : null;

Unless this is no longer true: Requirements: PHP 5.5.9+

PHP 7+ is required for ?? syntax to work.

swamp-dweller commented 5 years ago

I also have this problem. The suggested fix is not quite correct. Expressions of the form A ?? B need to be converted to isset( A ) ? A : B or ( null !== A ) ? A : B in order to work in PHP 5.6.