[PHP-DEV] Bug #10734: Strange conversion string->numbers From: konrad <email protected>
Date: 05/08/01

From: konrad <email protected>
Operating system: Linux 2.2 glibc-2.2.1
PHP version: 4.0.5
PHP Bug Type: *General Issues
Bug description: Strange conversion string-&gt;numbers

Here is a simple code

<?
header("content-type: text/plain");

$num = -5;
echo "$num\n";
$num++;
echo "$num\n";
$num--;
echo "$num\n";
echo "----------\n";

$num = "-5";
echo "$num\n";
$num++;
echo "$num\n";
$num--;
echo "$num\n";
?>

And here results

-5
-4
-5
----------
-5
-6 <-- ?????????????????
-7

It looks like "++" operator do not work properly on variables enclosed in double-quotes.
Other operators (ie $num = $num +1) woks properly.

-- 
Edit Bug report at: http://bugs.php.net/?id=10734&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>