Hi Andrei,
> I think it's a good idea. The only problem I see is making it work with
> all three serialization functions. wddx_serialize_value() is fine, but
> wddx_serialize_vars() and wddx_add_vars() take variable number of
> arguments, so it's not clear how it would work in those cases.
Yup, I don't think this can be implemented into current wddx
function, due to the interface of the functions as you said,
so I think you need to introduce a new function.
There's another good reason to justify the need of new function:
because you might want to limit the function to accept only
"single value" variable, which is not compatible with all
current functions.
What I mean with "single value" variable is, the variable shouldn't
have a complex "nested structure", because it could lead to ambiguity.
For example:
$complex_var = array (
0 => 'nothing',
'MyOS' => array('linux', 'win32', 'BSDI'), // normal array
'hash' => array('key' => 'val',
'key2' => 'val' ), //assoc array
'file' => "contain unicode char, so I want binary"
)
wddx_serialize($complex_var, WDDX_BINARY);
wddx_serialize($complex_var, WDDX_ARRAY);
wddx_serialize($complex_var, WDDX_HASH);
// what will happen if user call the function with those param?
Well, maybe this is not a good example, because actually I havent
really thought thoroughly whether this can really lead to ambiguity.
I just want to raise this issue, because I think this could be the
hardest part in implementing the feature.
Regards,
--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
They asked me "upgrade the NT server", so I installed UNIX
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php