Re: Windows development
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: Windows development | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-3441@lists.php.net to get a copy of this message | ||
> I have a few. How will wddx_serialize() know what the variable names are
> for the variables that it is passed? A couple of custom functions I put
> into PHP operate on variables in a similar manner, and what I do is pass
> them the variable names instead of values like this:
>
> $arr = compact("a", "b");
>
> This way it knows the variable name and can retrieve the value from the
> symbol table. It also supports the alternate syntax of compact(arrray("a",
> b")) if you have an array containing the variable names. Do you think
> something like this could work for wddx_serialize?
Yes, that is the tricky part. It would be nice if we had a way of getting
the variable name automatically in this case. One rather slow way is to
simply walk through the symbol hash table looking for the pointer. Not
extremely fast, but wddx_serialize() is probably not a function that is
ever going to be something people need extreme performance on. Although,
implementing it this way may be getting a bit silly.
The idea of simply passing the variable names instead of the variables
themselves is cleaner and probably the way to go.
> wddx_unserialize seems straightforward enough and should not present any
> problems. I could certainly work on this functionality...
I agree, this shouldn't be overly difficult. Sascha has already done most
of the tricky XML work here and there are other similar examples including
unserialize() in var.c and unpack() in pack.c. There are probably some
things common to these functions that could be combined into a new API
function to reduce code duplication as well.
-Rasmus
--
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