Bug #66053 [Opn->Nab]: var_Export / var_dump error
| From: | requinix@php.net | Date: | Thu, 07 Nov 2013 20:24:36 +0000 |
| Subject: | Bug #66053 [Opn->Nab]: var_Export / var_dump error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182638@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66053&edit=1
ID: 66053
Updated by: requinix@php.net
Reported by: remco dot pc at gmail dot com
Summary: var_Export / var_dump error
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Windows 7
PHP Version: 5.5.5
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Operator precedence: "test:".$nr+1 => ("test:".$nr)+1 => 1
You want
var_dump('test:' . ($nr + 1));
var_export('test:' . ($nr + 1));
Previous Comments:
------------------------------------------------------------------------
[2013-11-07 20:21:39] remco dot pc at gmail dot com
Description:
------------
when useing var_dump or var_export with the following code it goes wrong:
$nr = 0;
var_dump('test:'. $nr + 1); // result = int(1)
var_export('test:'. $nr +1); //result = int(1)
//expected string 'test:1'
var_dump('test:' . $nr); // result = 'test:0' string(6)
var_export('test:') . $nr); // result = 'test:0' string(6)
//ok
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66053&edit=1