php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16 problem print in a for loop....
Submitted: 1998-01-27 23:07 UTC Modified: 1998-02-12 01:04 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0b3 OS: Solaris 2.5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From:
New email:
PHP Version: OS:

 

 [1998-01-27 23:07 UTC]
/* Here is the the setup of my vars, the array is loaded
   up in some sql code not represented here.  It loads up
   fine
*/

$fieldstr =     "id title prod_key filename bytes last_mod ".
                "loc_type status_type type_type ram hd_mb ".
                "sound_type mhz_type proc_type blurb";
 
$fieldarr = explode(" ", $fieldstr);

$arraylen = count($fieldarr); 

/* This for loop does not put put a "<BR>\n" at the end
   of every line.
*/
for ($i = 0; $i < $arraylen; $i++) {
        $line = "$fieldarr[$i] = " . $$fieldarr[$i] . "<BR>\n";
        print("$line");
}

/* but the following does */
for ($i = 0; $i < $arraylen; $i++) {
        $line = "<BR>\n$fieldarr[$i] = " . $$fieldarr[$i];
        print("$line");
}


/* Any ideas? */ 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-12 01:04 UTC] rasmus
I am unable to reproduce this.  I am using the above script and it gives me <BR>'s after each line in
both loops.  Please try running this exact script.  Perhaps you overlooked something and aren't
telling us about all the factors.
 [2019-11-14 19:05 UTC] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348296
Log: Improve PHP_FLOAT_MIN doc

Patch by BenMorel.

Closes php/doc-en#16.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 07 07:01:29 2024 UTC