Which is better PHP SOAP or NuSOAP?

前端 未结 5 920
囚心锁ツ
囚心锁ツ 2020-12-29 04:52

Which is better PHP SOAP or NuSOAP ? Please help me out ?

5条回答
  •  时光说笑
    2020-12-29 05:21

    Another advantage of using Nusoap is that the result you get is already in an array. Normal PHP you get an object and you need to convert into an array yourself. and I did a small bench mark Nusoap is micro seconds faster than my own implementation including converting into an array. Nusoap = -1370852340.1761 Native PHP = -1370852340.2057

     public function objectToArray($obj) 
    {
        if(!is_array($obj) && !is_object($obj)) 
        return $obj;
    
        if(is_object($obj)) 
        $obj = get_object_vars($obj);
    
        return array_map(array($this, 'objectToArray'), $obj);
    }
    

提交回复
热议问题