diff options
| author | Thies C. Arntzen <thies@php.net> | 1999-09-15 11:42:28 +0000 |
|---|---|---|
| committer | Thies C. Arntzen <thies@php.net> | 1999-09-15 11:42:28 +0000 |
| commit | e7ad3bbec2fb1cac1723c5d30bf88cab694e90ee (patch) | |
| tree | 235d75241515f04b7d36e8e10cae97d8a4e41836 | |
| parent | 21a0c57cb1b94eff28ab2673fc742fb7f1f19116 (diff) | |
| download | php-git-e7ad3bbec2fb1cac1723c5d30bf88cab694e90ee.tar.gz | |
use new API in var.c
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | ext/standard/var.c | 18 |
2 files changed, 11 insertions, 11 deletions
@@ -2,8 +2,8 @@ PHP 4.0 CHANGE LOG ChangeLog ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ?? 1999, Version 4.0 Beta 3 -- Made serialize/unserialize work on classes. CAUTION: when unserializing the - class to be unserialized needs to be known! (Thies) +- Made serialize/unserialize work on classes & speedups. CAUTION: when + unserializing the class to be unserialized needs to be known! (Thies) - Reworked preg_* functions according to the new PCRE API, which also made them behave much more like Perl ones (Andrey) - Made it possible to specify external location of PCRE library (Andrey) diff --git a/ext/standard/var.c b/ext/standard/var.c index 83b7ef8516..5a19b6fc0b 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -431,17 +431,16 @@ int php3api_var_unserialize(pval **rval, const char **p, const char *max) /* {{{ proto string serialize(mixed variable) Returns a string representation of variable (which can later be unserialized) */ PHP_FUNCTION(serialize) - { - pval *struc; + pval **struc; - if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &struc) == FAILURE) { + if (ARG_COUNT(ht) != 1 || getParametersEx(1, &struc) == FAILURE) { WRONG_PARAM_COUNT; } return_value->type = IS_STRING; return_value->value.str.val = NULL; return_value->value.str.len = 0; - php3api_var_serialize(return_value, &struc); + php3api_var_serialize(return_value, struc); } /* }}} */ @@ -451,14 +450,15 @@ PHP_FUNCTION(serialize) PHP_FUNCTION(unserialize) { - pval *buf; + pval **buf; - if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &buf) == FAILURE) { + if (ARG_COUNT(ht) != 1 || getParametersEx(1, &buf) == FAILURE) { WRONG_PARAM_COUNT; } - if (buf->type == IS_STRING) { - const char *p = buf->value.str.val; - if (!php3api_var_unserialize(&return_value, &p, p + buf->value.str.len)) { + if ((*buf)->type == IS_STRING) { + const char *p = (*buf)->value.str.val; + + if (!php3api_var_unserialize(&return_value, &p, p + (*buf)->value.str.len)) { RETURN_FALSE; } } else { |
