PHP 4.0 Bug #6149: Print does not format output correctly

From: Date: Mon, 14 Aug 2000 15:02:49 +0000
Subject: PHP 4.0 Bug #6149: Print does not format output correctly
Groups: php.dev 
Request: Send a blank email to php-dev+get-28822@lists.php.net to get a copy of this message
From: tim@timcrider.com Operating system: Solaris 2.7 SPARC PHP version: 4.0.1pl2 PHP Bug Type: Scripting Engine problem Bug description: Print does not format output correctly PHP CONFIGURE INFO: './configure' '--with-apache=../apache_1.3.12' '--without-gd' '--with-mysql' '--disable-debug' '--enable-track-vars' OS INFO: SunOS dev0.pgh.directstuff.com 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-60 --- BUG DESCRIPTION --- When I use a for loop to display results taken from a function, the format is not correct. Here the script that reproduces the error: <? function what_is_j($i) { $j = $i + 2; print "($j)"; } for ($i = 0; $i < 10; $i++) { print "$i - " . what_is_j($i) . "\n"; } ?> The output should look like: 0 - (0) 1 - (2) 2 - (4) ... However the output looks like: (2)0 - (3)1 - (4)2 - (5)3 - (6)4 - (7)5 - (8)6 - (9)7 - (10)8 - (11)9 - If you need any further information please email me @ tim@timcrider.com. Tim Crider

« previous php.dev (#28822) next »