fork download
  1. <?php
  2.  
  3. class CheckRenew
  4. {
  5. public $zip;
  6. public $email;
  7. public $addressNumber;
  8. protected $custom2Id;
  9. public function __construct($info)
  10. {
  11. foreach($info as $key => $value)
  12. {
  13. $this->$key = $value;
  14. }
  15. }
  16. }
  17.  
  18.  
  19. $subscription = new CheckRenew([
  20. 'custom2Id' => 13,
  21. 'email' => 'someemail@email.com',
  22. 'zip' => '90530000',
  23. 'addressNumber' => '1234'
  24. ]);
  25.  
  26.  
  27. var_dump($subscription);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
object(CheckRenew)#1 (4) {
  ["zip"]=>
  string(8) "90530000"
  ["email"]=>
  string(19) "someemail@email.com"
  ["addressNumber"]=>
  string(4) "1234"
  ["custom2Id":protected]=>
  int(13)
}