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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC