Structs data type in php?

后端 未结 7 1470
悲哀的现实
悲哀的现实 2020-12-07 17:47

Can anyone give me example for structs data type in php ? How come there is something like structs in php all of a sudden ?

7条回答
  •  悲哀的现实
    2020-12-07 18:07

    It seems that the struct datatype is commonly used in SOAP:

    var_dump($client->__getTypes());
    
    array(52) {
      [0] =>
      string(43) "struct Bank {\n string Code;\n string Name;\n}"
    }
    

    This is not a native PHP datatype!

    It seems that the properties of the struct type referred to in SOAP can be accessed as a simple PHP stdClass object:

    $some_struct = $client->SomeMethod();
    echo 'Name: ' . $some_struct->Name;
    

提交回复
热议问题