You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Robert Lu <ro...@gmail.com> on 2017/10/08 17:16:00 UTC

how to use set in php?

Hi,

I write a echoF function:

namespace php tutorial

service Ping {
    set<string> echoF(1: set<  string > is_real),
}

And I implement it(in php):

class ExampleService implements PingIf
{
    public function echoF(array $list_test)
    {
        return $list_test;
    }
}
But, When I call echoF:

$arg = ["s1", "s3", "s5", "s7"];
$res = $client->echoF($arg);

var_dump($arg);
var_dump($res);
It outputs:

thrift_example/client.php:28:
array(4) {
  [0] =>
  string(2) "s1"
  [1] =>
  string(2) "s3"
  [2] =>
  string(2) "s5"
  [3] =>
  string(2) "s7"
}
thrift_example/client.php:29:
array(4) {
  [0] =>
  bool(true)
  [1] =>
  bool(true)
  [2] =>
  bool(true)
  [3] =>
  bool(true)
}


Is it caused by I use set<string> ? How Can I echo a set<string>? Or, it's a bug?