php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49603 display problems
Submitted: 2009-09-19 21:10 UTC Modified: 2009-09-20 08:57 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: peiciu at gmail dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.2.11 OS: win XP sp3
Private report: No CVE-ID: None
 [2009-09-19 21:10 UTC] peiciu at gmail dot com
Description:
------------
display problems with function

Reproduce code:
---------------
<?php  $val = "";
function write($val)
{ if($val == 11)
  {echo "text";}
  else if($val == 12)
  {echo "Text";}
  else if($val == 13)
  {echo "TEXT";}
  else if($val < 11)
  {echo $val;}
}
$val_3 = "13";
echo "<pre>" . write($val_3) . " - " . write($val_3) . ":" . write($val_3) . "</pre><br />";?>

Expected result:
----------------
TEXT - TEXT:TEXT


Actual result:
--------------
TEXTTEXTTEXT

 - :

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-20 08:57 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You do a concatenation before echo\'ing the result, for doing that write() is being called which creates output...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 06:01:28 2024 UTC