cvs: /php4/ext/standard var.c

From: Date: Sun, 02 Jan 2000 11:49:58 +0000
Subject: cvs: /php4/ext/standard var.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-8808@lists.php.net to get a copy of this message
thies Sun Jan 2 06:49:58 2000 EDT Modified files: /php4/ext/standard var.c Log: (var_dump, serialize, unserialize) support NULL @- Added new NULL constant (Zeev, Zend library) Index: php4/ext/standard/var.c diff -u php4/ext/standard/var.c:1.43 php4/ext/standard/var.c:1.44 --- php4/ext/standard/var.c:1.43 Fri Dec 31 20:31:53 1999 +++ php4/ext/standard/var.c Sun Jan 2 06:49:27 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c,v 1.43 2000/01/01 01:31:53 sas Exp $ */ +/* $Id: var.c,v 1.44 2000/01/02 11:49:27 thies Exp $ */ /* {{{ includes @@ -48,6 +48,11 @@ PHPWRITE(&buf[1], i - 1); break; + case IS_UNSET: + i = sprintf(buf, "%*cNULL\n", level, ' '); + PHPWRITE(&buf[1], i - 1); + break; + case IS_LONG: i = sprintf(buf, "%*cint(%ld)\n", level, ' ', (*struc)->value.lval); PHPWRITE(&buf[1], i - 1); @@ -198,6 +203,10 @@ STR_CAT(buf, s, slen); return; + case IS_UNSET: + STR_CAT(buf, "N;", 2); + return; + case IS_LONG: slen = sprintf(s, "i:%ld;", (*struc)->value.lval); STR_CAT(buf, s, slen); @@ -296,6 +305,16 @@ ELS_FETCH(); switch (cur = **p) { + case 'N': + if (*((*p) + 1) != ';') { + return 0; + } + (*p)++; + INIT_PZVAL(*rval); + (*rval)->type = IS_UNSET; + (*p)++; + return 1; + case 'b': /* bool */ case 'i': if (*((*p) + 1) != ':') { @@ -439,8 +458,8 @@ ALLOC_ZVAL(key); ALLOC_ZVAL(data); if (!php_var_unserialize(&key, p, max)) { - zval_dtor(key); - efree(key); + zval_dtor(key); + efree(key); efree(data); return 0; }

« previous php.version4 (#8808) next »