Re: [PHP-DEV] Bug #1235: string arithmetical misbehaviour From: Andi Gutmans (andi <email protected>)
Date: 03/15/99

The leak should be fixed now.

Andi

At 14:04 15/03/99 +0100, Sascha Schumann wrote:
>On Mon, Mar 15, 1999 at 11:13:04AM -0000, tolj <email protected> wrote:
>> From: tolj <email protected>
>> Operating system: Linux 2.0.36
>> PHP version: 3.0.7
>> PHP Bug Type: Misbehaving function
>> Bug description: string arithmetical misbehaviour
>>
>> what about this misbehaviour of string arithmetics:
>>
>> $foo = "04";
>> $foo++;
>> echo $foo; ## reports "05"
>>
>> $foo = "04";
>> $foo--;
>> echo $foo; ## reports "3" without leading zero !!
>>
>> I suppose both should react the same, or am I wrong?!
>
>Btw, running the above script yields:
>
>[sas <email protected> php3]$ ./php
><?
>$foo = "04";
>$foo++;
>echo $foo; ## reports "05"
>
>$foo = "04";
>$foo--;
>echo $foo; ## reports "3" without leading zero !!
>Content-type: text/html
>
>053Freeing 0x201A9650 (3 bytes), allocated in operators.c on line 730<br>
>
>---
>if (op1->value.str.len == 0) {
> /* Takes care of empty_string etc. cases where we can't erealloc() */
> result->value.str.val = (char *) emalloc(result->value.str.len + 1);
> STR_FREE(op1->value.str.val);
>}
>---
>
>CVS version from yesterday.
>
>--
>
> Regards,
>
> Sascha Schumann |
> Consultant | finger sas <email protected>
> | for PGP public key
>
>--
>PHP Development Mailing List http://www.php.net/
>To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
>For help: php-dev-help <email protected>
>
>
>

---
Andi Gutmans <andi <email protected>>
ICQ: 1568297
PGP: finger andi <email protected>

-- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe <email protected> For help: php-dev-help <email protected>