Bug #3399: postfix increment operator (++) fails to cast string to integer
| From: | athompso at commerced dot com | Date: | Fri, 04 Feb 2000 03:44:27 +0000 |
| Subject: | Bug #3399: postfix increment operator (++) fails to cast string to integer | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15182@lists.php.net to get a copy of this message | ||
From: athompso@commerced.com
Operating system: Solaris
PHP version: 3.0.12
PHP Bug Type: Misbehaving function
Bug description: postfix increment operator (++) fails to cast string to integer
Test case:
$i = '-1';
$i++;
echo "i = $i\ntype = " . gettype($i) . "\n";
Output:
i=-2 (****questionable behaviour****)
type=string (****questionable behaviour****)
Reference Case:
$i = '-1';
$i--;
echo "i = $i\ntype = " . gettype($i) . "\n";
Output:
i=-2
type=integer