Req #63745 [NEW]: Var_dump on null characters
From: jesper dot hag at gmail dot com
Operating system: CentOS
PHP version: 5.3Git-2012-12-11 (Git)
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:Var_dump on null characters
Description:
------------
*Note* My PHP version is actually 5.3.3
The problem I've come up to is that printing a string with var_dump (for
debugging
purpose eg.) that contains null-characters are counted in the string length
but
are not in any way displayed in the var_dump output.
I'm not sure this should be considerate a bug or a feature request because
it is
something I want and perhaps not something that per design should be in
this way.
Test script:
---------------
<?php
$string = "123456"; // len 6
$string[0] = ''; (or = null, or = "\0")
var_dump($string); // Outputs string(6) "23456"
?>
Expected result:
----------------
I would expect the above script to output something like string(6)
"\0123456",
that - in my world - would make more sense.
--
Edit bug report at https://bugs.php.net/bug.php?id=63745&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63745&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63745&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63745&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63745&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63745&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63745&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63745&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63745&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63745&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63745&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63745&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63745&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63745&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63745&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63745&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63745&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63745&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63745&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63745&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63745&r=mysqlcfg
Thread (3 messages)
- jesper dot hag at gmail dot com