Home Help Center

Ice php error report

fengxbfengxb Member feng xuebinOrganization: jiexin techProject: scientific calculation
Hi,

The following is my test ice file:
#ifndef HELLO_ICE
#define HELLO_ICE
#include <c:/Icephp/ICE/Identity.ice>

struct ID
{
	Ice::Identity a;
	string b;
};

struct SMData
{
	int nSN;
	string szCalled;
	string szCalling;
};

dictionary<ID, SMData> SMDataDict;
dictionary<int, SMDataDict> MySMDataDict;
class Hello
{
    nonmutating void sayHello();
    idempotent void shutdown();
    void Query(out MySMDataDict ret);
};

#endif
/////////////////////////////////////////////////////////////
The client calls Hello's function "Query" and hope to get returned data. The client programmed with C++ works fine but one programmed with PHP produces an error. The phpice.dll reports a null point error.

The version of Ice is 1.3.0. The version of Ice_php is 1.0.2.

Thanks a lot for any replies.

Fengxb

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    IcePHP does not currently support the use of complex types as dictionary keys. This is because Slice dictionaries are mapped to PHP associative arrays, and PHP only supports integer and string key types.

    Adding support for complex keys is complicated because we will essentially need to write a hashtable in PHP, and then decide whether to use that for all Slice dictionaries, or only ones with complex keys. Using our own hashtable means you would forfeit the use of PHP's convenient array notation, so I'd be reluctant to use it for dictionaries with primitive key types, but on the other hand it would also be awkward to have two separate dictionary mappings.

    Take care,
    - Mark
  • fengxbfengxb Member feng xuebinOrganization: jiexin techProject: scientific calculation
    Thans a lot. Its better that Php call method is equal to C++.:p
Sign In or Register to comment.