|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-15 12:52 UTC] derick@php.net
[2004-10-15 14:02 UTC] eikke at eikke dot com
[2004-11-27 16:43 UTC] tony2001@php.net
[2004-12-08 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 23 06:00:02 2025 UTC |
Description: ------------ When running the following code, the output in browser isn't what one would expect (there's a "&" missing). If one outputs something after the echo(substr()) (like, echo "test") it works fine, also if one outputs characters after the "?>" This bug has been confirmed by Saveas on #php, freenode, running PHP 4.3.2 on Debian Apache1, and by me on 2 mod_php 4.3.9, Apache 2.0.51 Gentoo Linux systems (twice another configuration tough) It does look like a buffer flush problem. Reproduce code: --------------- <?php $t = array("t","e","s","t","j","e"); array_push($t, "t"); array_unshift($t, ""); var_dump($t); echo "\n<br />"; $tmp = implode("&", $t); echo $tmp; echo "\n<br />"; echo(substr($tmp, 0, -1)); //echo "<br />test"; ?> Expected result: ---------------- array(8) { [0]=> string(0) "" [1]=> string(1) "t" [2]=> string(1) "e" [3]=> string(1) "s" [4]=> string(1) "t" [5]=> string(1) "j" [6]=> string(1) "e" [7]=> string(1) "t" } &t&e&s&t&j&e&t &t&e&s&t&j&e& Actual result: -------------- array(8) { [0]=> string(0) "" [1]=> string(1) "t" [2]=> string(1) "e" [3]=> string(1) "s" [4]=> string(1) "t" [5]=> string(1) "j" [6]=> string(1) "e" [7]=> string(1) "t" } &t&e&s&t&j&e&t &t&e&s&t&j&e