ID:               32495
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mike at cocoweb dot co dot uk
-Status:           Open
+Status:           Feedback
 Bug Type:         Strings related
 Operating System: Windows XP
 PHP Version:      5.0.3
 New Comment:

Yes, I *AM* sure.
Try it with PHP CLI and if it works - fix your browser/editor instead.


Previous Comments:
------------------------------------------------------------------------

[2005-03-30 13:27:55] mike at cocoweb dot co dot uk

Are you sure you are getting:

   echo "<bob ".func()."></bob>"

and not, as I am getting:

   echo "<bob .func().></bob>"


I am definitely not making this up :o)  I have just reinstalled PHP
5.0.3 and it STILL fails.

I think we need to investigate this further before closing it.

------------------------------------------------------------------------

[2005-03-30 12:52:56] [EMAIL PROTECTED]

Works perfectly here.

------------------------------------------------------------------------

[2005-03-30 12:44:25] mike at cocoweb dot co dot uk

Check out "Actual result: Expression 1". The double quotes are missing
around .func()

I should have made it more clear.

------------------------------------------------------------------------

[2005-03-30 07:45:50] [EMAIL PROTECTED]

I would be very worried if the output wasn't what you got.
(you're using single quotes..are you sure you've pasted the right code
here? :)


------------------------------------------------------------------------

[2005-03-30 04:49:20] mike at cocoweb dot co dot uk

Description:
------------
Unexpected output with echo statement.


Reproduce code:
---------------
<?php

// Expression 1
echo 'echo "<bob ".func()."></bob>";';

// Newline for "view source"
echo "\n";

// Expression 2
echo 'echo "<bob value=".func()."></bob>";';

// Newline for "view source"
echo "\n";

// Expression 3
echo 'echo "bob ".func()."></bob>";';

?>


Expected result:
----------------
echo "<bob ".func()."></bob>";

echo "<bob value=".func()."></bob>";

echo "bob ".func()."></bob>";


// Note extra newlines for ease of reading.

Actual result:
--------------
echo "<bob .func().></bob>";
echo "<bob value=".func()."></bob>";
echo "bob ".func()."></bob>";

Line 2 and 3 are expected.  Line 1 is just plain weird!

Note that the '=' after 'value' makes the output work correctly. 
Bizarre.  I have looked in PHP books, the web and asked a couple of
experts all to no avail.

You can reduce the original code down to:
echo 'echo "<bob =".func()."></bob>";';

and it will give expected result!  But remove the equals sign and the
bug will occur.


Also note removing the first < (i.e. before bob) will work too.  (see
expression 3).

I'm possibly having a REALLY bad coding day and making a REALLY simple
error...



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32495&edit=1

Reply via email to