CVS update: php4/ext/standard

From: Date: Thu, 01 Jul 1999 09:26:05 +0000
Subject: CVS update: php4/ext/standard
Groups: php.version4 
Request: Send a blank email to php-version4+get-1773@lists.php.net to get a copy of this message
Date: Thursday July 1, 1999 @ 5:26 Author: thies Update of /repository/php4/ext/standard In directory php:/tmp/cvs-serv9063 Modified Files: var.c Log Message: changed boolean behaviour: var_dump( Index: php4/ext/standard/var.c diff -u php4/ext/standard/var.c:1.14 php4/ext/standard/var.c:1.15 --- php4/ext/standard/var.c:1.14 Thu Jul 1 01:47:06 1999 +++ php4/ext/standard/var.c Thu Jul 1 05:26:05 1999 @@ -51,6 +51,11 @@ char buf[512]; switch ((*struc)->type) { + case IS_BOOL: + i = sprintf(buf, "%*cbool(%s)\n", level, ' ', ((*struc)->value.lval?"true":"false")); + PHPWRITE(&buf[1], i - 1); + break; + case IS_LONG: i = sprintf(buf, "%*cint(%ld)\n", level, ' ', (*struc)->value.lval); PHPWRITE(&buf[1], i - 1); @@ -165,6 +170,11 @@ int i, ch; switch ((*struc)->type) { + case IS_BOOL: + slen = sprintf(s, "b:%ld;", (*struc)->value.lval); + STR_CAT(buf, s, slen); + return; + case IS_LONG: slen = sprintf(s, "i:%ld;", (*struc)->value.lval); STR_CAT(buf, s, slen); @@ -293,8 +303,10 @@ const char *q; char *str; int i; + char cur; - switch (**p) { + switch (cur = **p) { + case 'b': /* bool */ case 'i': if (*((*p) + 1) != ':') { return 0; @@ -307,7 +319,11 @@ return 0; } (*p)++; - (*rval)->type = IS_LONG; + if (cur == 'b') { + (*rval)->type = IS_BOOL; + } else { + (*rval)->type = IS_LONG; + } (*rval)->refcount = 1; (*rval)->is_ref = 0; (*rval)->value.lval = atol(q + 2);

« previous php.version4 (#1773) next »