[php-src] Issue #7739: add creating object constructor from Jason

From: Date: Wed, 08 Dec 2021 14:10:36 +0000
Subject: [php-src] Issue #7739: add creating object constructor from Jason
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238281@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7739
Author: loveyandex

### Description

add this signature and syntax to PHP core to enjoy developer from fast developing 



```
class MyObject{

__json_constructor( {"AdditionAmount": 0 // default value,
                "CashRegisterDeviceRef": null,
                "CustomerAddressRef": null,
                "DeliveryDesc": "",
                "Description": null,
                "DeviceReceiptCode": null,
                "DocumentRef": 0,
                "EffectiveNetPrice": 11678899,
                "ExcludedPolicies": "",
                "Fee": 11678899.000000,
                "FreeProductBusinessPolicyConditionRowRef": null,
                "FreeProductBusinessPolicyRef": null,
                "HasReservation": false,
              
            })


}

//create new that instance :
$obj= new MyObject({"AdditionAmount": 0,
                "CashRegisterDeviceRef": null,
                "CustomerAddressRef": null,
                "DeliveryDesc": "",
                "Description": null,
                "DeviceReceiptCode": null,
                "DocumentRef": 0,
                "EffectiveNetPrice": 11678899,
                "ExcludedPolicies": "",
                "Fee": 11678899.000000,
                "FreeProductBusinessPolicyConditionRowRef": null,
                "FreeProductBusinessPolicyRef": null,
                "HasReservation": false,
              
            })


```


Thread (1 message)

  • noreply@php.net
« previous php.bugs (#238281) next »