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
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: peiciu at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Apr 25 19:01:33 2024 UTC