How to get the value of this kind of data?

object(EasySwoole\Core\Http\Message\UploadFile)-sharp44 (6) {
  ["tempName":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  string(25) "/tmp/swoole.upfile.82hJyH"
  ["stream":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  object(EasySwoole\Core\Http\Message\Stream)-sharp45 (6) {
    ["stream":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    resource(52) of type (stream)
    ["seekable":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    bool(true)
    ["readable":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    bool(true)
    ["writable":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    bool(true)
    ["readList":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    array(16) {
      ["r"]=>
      bool(true)
      ["w+"]=>
      bool(true)
      ["r+"]=>
      bool(true)
      ["x+"]=>
      bool(true)
      ["c+"]=>
      bool(true)
      ["rb"]=>
      bool(true)
      ["w+b"]=>
      bool(true)
      ["r+b"]=>
      bool(true)
      ["x+b"]=>
      bool(true)
      ["c+b"]=>
      bool(true)
      ["rt"]=>
      bool(true)
      ["w+t"]=>
      bool(true)
      ["r+t"]=>
      bool(true)
      ["x+t"]=>
      bool(true)
      ["c+t"]=>
      bool(true)
      ["a+"]=>
      bool(true)
    }
    ["writeList":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    array(17) {
      ["w"]=>
      bool(true)
      ["w+"]=>
      bool(true)
      ["rw"]=>
      bool(true)
      ["r+"]=>
      bool(true)
      ["x+"]=>
      bool(true)
      ["c+"]=>
      bool(true)
      ["wb"]=>
      bool(true)
      ["w+b"]=>
      bool(true)
      ["r+b"]=>
      bool(true)
      ["x+b"]=>
      bool(true)
      ["c+b"]=>
      bool(true)
      ["w+t"]=>
      bool(true)
      ["r+t"]=>
      bool(true)
      ["x+t"]=>
      bool(true)
      ["c+t"]=>
      bool(true)
      ["a"]=>
      bool(true)
      ["a+"]=>
      bool(true)
    }
  }
  ["size":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  int(288785)
  ["error":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  int(0)
  ["clientFileName":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  string(26) "103836s44klqli6xeldaoo.jpg"
  ["clientMediaType":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  string(10) "image/jpeg"
}
Php
Aug.11,2021

external words only public can get the value, while your pile of private


is very similar to thinkphp style. The landlord can post the code to obtain this thing, and maybe he can get


in other more convenient ways.

first of all, you have to learn how to read the documentation, the first one you have found the class, why not just look at the source code. The following is what I intercepted from the source code.

    public function getStream()
    {
        // TODO: Implement getStream() method.
        return $this->stream;
    }
    public function moveTo($targetPath)
    {
        // TODO: Implement moveTo() method.
        return file_put_contents($targetPath,$this->stream) ? true :false;
    }
    public function getSize()
    {
        // TODO: Implement getSize() method.
        return $this->size;
    }
    public function getError()
    {
        // TODO: Implement getError() method.
        return $this->error;
    }
    public function getClientFilename()
    {
        // TODO: Implement getClientFilename() method.
        return $this->clientFileName;
    }
    public function getClientMediaType()
    {
        // TODO: Implement getClientMediaType() method.
        return $this->clientMediaType;
    }

Please check the source code for yourself.

Menu