php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6031 concating return values to a string?
Submitted: 2000-08-08 19:13 UTC Modified: 2000-09-02 17:56 UTC
From: lg at netside dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1pl2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lg at netside dot de
New email:
PHP Version: OS:

 

 [2000-08-08 19:13 UTC] lg at netside dot de
Look at this code:

         function strhex($ni) {
           $ni=dechex($ni);
           while (strlen($ni)<2) $ni="0".$ni;
           return $ni;
         }

         $color=strhex($r).strhex($g).strhex($b);
         echo $color;

it works fine if nothing else in a file :(
I have one file using that code that's not working under PHP4, but works great under PHP3. (same server, different port) :(((

so I tried

              $color=strhex($r);
              $color.=strhex($g);
              $color.=strhex($b);

instead the last line and it worked fine. I could'nt find any error, so I thought this may be interesting 4 you (whether I know this error - if it is one - might be hard to find and the description is)...

I also tracked that variables... the function calculates the correct value (e.g. "9b") every time, but the 3 values are not concated in the right way (its running in a loop, any second cicle all values are calculated correct, but I only get "9b9b" instead of "9b9b9b"; the other cicle everything is OK)

PHP(4) is compiled using the standard settings with the latest apache stable (.12) and mysql.libs

sorry for my english & stay tuned
  Lars


 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-09 06:14 UTC] stas@php.net
Could you provide a short example of code that doesn't work?
 [2000-09-02 17:56 UTC] sniper@php.net
No feedback from user. Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 06:01:34 2024 UTC