Re: WDDX

From: Date: Thu, 07 Jan 1999 12:49:00 +0000
Subject: Re: WDDX
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-3362@lists.php.net to get a copy of this message
On Thu, Jan 07, 1999 at 12:51:42AM -0500, Rasmus Lerdorf wrote: > > It's already implemented. Note though that the code is not extensively tested > > and was developed from the elements.c sample in the expat library without > > further knowledge of the parser or XML in general. > > > > It's up to you, if you want to extend it/rewrite it/make it better. I have not > > come around to extend the serializer to encode binary strings, for example. > > Happy hacking. > > I'm playing with it and have hit a bug: > > $a = 1; > $b = "abc"; > echo wddx_serialize(array($a,$b)); It's not a bug (it's not a feature either), but in its current incarnation it requires (and assumes) an associative array at the top (this could be made more flexible by changing one line, but read on) wddx_serialize(array("a" => $a, "b" => $b)) The functions are currently not documented, because I think it would be better to allow a less restrictive way of using it. So you could write instead of the above example wddx_serialize($a, $b) resulting in <...> <var name='a'> <number>1</number> </var> <var name='b'> <string>abc</string> </var> <...> The short form is faster to write, easier to read and faster to debug. However it creates certain restrictions (e.g. different variable names in WDDX/PHP) which cannot be easily resolved. Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#3362) next »