From: php-lists at nomeaning dot net Operating system: linux RH 9 PHP version: 5CVS-2004-04-15 (dev) PHP Bug Type: Output Control Bug description: spprintf() output inconsistent for %p (fix included)
Description: ------------ In all functions using spprintf(), the output corresponding to the format conversion specifier "%p" depends on the value of the *previous* argument (if any). If the previously-converted argument was a non-zero integer, the string output will be prefixed with "0x", as intended. If the previously-converted argument was zero or a non-integer, the prefix will be missing. Reproduce code: --------------- I suspect you'll be able to clearly see this problem when examining the attached patch (fix), but I will attach a second patch which may be temporarily applied to php-src/ext/standard/var.c which causes php_var_dump to display the addresses of zval*s for the values displayed in a dump. To reproduce the error, simply (in a PHP script) assign several numeric and non-numeric values to elements in an array, then use var_dump to display the contents of the array. Expected result: ---------------- "0x" should prefix every pointer value, to indicate a hexadecimal address. -- Edit bug report at http://bugs.php.net/?id=28012&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28012&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28012&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28012&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28012&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28012&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28012&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28012&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28012&r=support Expected behavior: http://bugs.php.net/fix.php?id=28012&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28012&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28012&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28012&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28012&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28012&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28012&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28012&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28012&r=float