#46345 [Opn->Bgs]: String to integer conversion
| From: | derick@php.net | Date: | Mon, 20 Oct 2008 11:48:19 +0000 |
| Subject: | #46345 [Opn->Bgs]: String to integer conversion | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-129869@lists.php.net to get a copy of this message | ||
ID: 46345
Updated by: derick@php.net
Reported By: paul dot guhl at mayflower dot de
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: any
PHP Version: 5.2.6
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Sorry, this is expected (and documented at
http://no.php.net/manual/en/language.operators.increment.php)
Previous Comments:
------------------------------------------------------------------------
[2008-10-20 11:44:18] paul dot guhl at mayflower dot de
Description:
------------
Error occurs while implicit string to integer conversion, which should
be performed by the prefix incermention. The ++ operator takes the input
string as such and... "increments" the last character of the string.
Error faced with PHP 5.2.0, 5.2.3 and 5.2.6. The test case was inspired
by the Zend Certification Book :)
Reproduce code:
---------------
$a = 'Test';
echo ++$a;
Expected result:
----------------
1
Actual result:
--------------
Tesu
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46345&edit=1