略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SoapVar

2024-11-13

The SoapVar class

(PHP 5, PHP 7, PHP 8)

简介

A class representing a variable or object for use with SOAP services.

类摘要

class SoapVar {
/* 属性 */
public int $enc_type;
public mixed $enc_value = null;
public ?string $enc_stype = null;
public ?string $enc_ns = null;
public ?string $enc_name = null;
public ?string $enc_namens = null;
/* 方法 */
public __construct(
    mixed $data,
    ?int $encoding,
    ?string $typeName = null,
    ?string $typeNamespace = null,
    ?string $nodeName = null,
    ?string $nodeNamespace = null
)
}

属性

enc_name

enc_namens

enc_ns

enc_type

enc_stype

enc_value

目录

add a noteadd a note

User Contributed Notes 1 note

up
2
seth dot johnson at gmail dot com
7 years ago
It is not documented and thus may be subject to change but if you need to inspect the constructed SoapVar it sets everything you pass it on public variables:

<?php
$foo
= new \stdClass();
$foosoap = new \SoapVar($foo, SOAP_ENC_OBJECT, 'Foo');
var_dump($foosoap);
echo
$foosoap->enc_stype;
echo
get_class($foosoap->enc_value);
?>

Will output (tested in PHP 5.3.3 cli):

object(SoapVar)#2 (3) {
  ["enc_type"]=>
  int(301)
  ["enc_value"]=>
  object(stdClass)#1 (0) {
  }
  ["enc_stype"]=>
  string(3) "Foo"
}

Foo
stdClass

官方地址:https://www.php.net/manual/en/class.soapvar.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3