ID: 29820 User updated by: ericp at amazon dot com Reported By: ericp at amazon dot com -Status: Open +Status: Bogus Bug Type: Variables related Operating System: Linux 2.4.21-2.3a i686 PHP Version: 5.0.1 New Comment:
It was a problem in Mozilla's Developer Tools...It reruns the query to get the response headers ... Previous Comments: ------------------------------------------------------------------------ [2004-08-24 17:00:39] ericp at amazon dot com Description: ------------ If I include a serialized variable in header() it produces an entirely different result than if I just print() the result... I've also tested: 4.3.3, 5.0.0 and of course 5.0.1 and its reproducable in both scenario Make sure you POST the form to get the variable back :) even a strlen($s) will produce different results...its weird. Thanks, Eric Reproduce code: --------------- <?php function jpcache_debug2($s) { header("X-CacheDebug-five: $s"); print $s; } $myVariable = serialize($_POST); jpcache_debug2($myVariable); ?> <html><body> <form method="POST" action="test-error.php"> <input type="hidden" name="foo" value="bar"> <input type="submit" value="blah"> </form> </body> </html>bash-2.05$ Expected result: ---------------- Response Headers Date: Tue, 24 Aug 2004 14:49:52 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/5.0.1 mod_ssl/2.8.12 OpenSSL/0.9.6b X-Powered-By: PHP/5.0.1 X-CacheDebug-five: a:1:{s:3:"foo";s:3:"bar";} Connection: close Transfer-Encoding: chunked Content-Type: text/html a:1:{s:3:"foo";s:3:"bar";} <html> <body> <form method="POST" action="test-error.php"> <input type="hidden" name="foo" value="bar"> <input type="submit" value="blah"> </form> </body> </html> Actual result: -------------- Response Headers Date: Tue, 24 Aug 2004 14:49:52 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/5.0.1 mod_ssl/2.8.12 OpenSSL/0.9.6b X-Powered-By: PHP/5.0.1 X-CacheDebug-five: a:0:{} <--- WHAT?!? Connection: close Transfer-Encoding: chunked Content-Type: text/html a:1:{s:3:"foo";s:3:"bar";} <html> <body> <form method="POST" action="test-error.php"> <input type="hidden" name="foo" value="bar"> <input type="submit" value="blah"> </form> </body> </html> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29820&edit=1