PHP Compatibilty issues with double underscore prefixes

Created on 31 May 2021, over 3 years ago
Updated 10 June 2023, over 1 year ago

Problem/Motivation

PHP has reserved all method names with a double underscore prefix for future use. They cause compatibility issues with the newer Stripe PHP Library.

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom jbodony

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I got caught by this bug and fixed it by replacing __toJSON to with toJSON everywhere (e.g.)

    $transaction->payload[REQUEST_TIME] = $response->__toJSON();
    

    with

    $transaction->payload[REQUEST_TIME] = $response->toJSON();
    

    I'm new to this project, but is there a way to check the stripe library and picking which method to use depending on the library found?

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Issue was unassigned.
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.71.5 2024