php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67158 unwanted semicolon in output
Submitted: 2014-04-30 12:26 UTC Modified: 2014-05-12 11:33 UTC
From: jcmartin70 at hotmail dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.4.27 OS: Windows XP
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: jcmartin70 at hotmail dot com
New email:
PHP Version: OS:

 

 [2014-04-30 12:26 UTC] jcmartin70 at hotmail dot com
Description:
------------
I have the following code. When parsed into the browser I am getting a semicolon right in front of the <td> in the first row of the table. I have placed a capital "X" in the code to show exactly where the semicolon shows up. I have tried deleting the white space etc., there are no semicolons in the code or leaking in from the style sheet. It would appear that the parsing engine is putting the semicolon right in the beginning of the table. The script uses the heredoc syntax and is running in a separate file called by AJAX. Thanks.

Test script:
---------------
		$tableheader=<<<abc
			<br/><div id="divContainer">
			<table class="formatHTML5">
			<colgroup>
				<col width="5%">
				<col width="15%">
				<col width="15%">
				<col width="15%">
				<col width="30%">
				<col width="15%">
				<col width="5%">
			</colgroup>
			<thead>
				<tr>
					X<td colspan="7" style="font-size:14px"><p><b>Hi $first you have $recsout searches available this month</b></p><b>Type the Phrase in the Appropriate Search Engine and Answer the Question<br/>Click on Next Term<br/>Click Logoff at any time to save your session if you cannot finish in one sitting</b></td>
				</tr>
				<tr>
					<th></th>
					<th>Go To</th>
					<th>Search for this Phrase</th>
					<th>Click on this Link</th>
					<th>Answer this Question</th>
					<th>Your Answer</th>
					<th>Answer Flag</th>
				</tr>
			</thead>
			<tbody>
abc;
echo $$tableheader;

Expected result:
----------------
HERE IS THE OUTPUT AS RENDERED:

X;
Hi jack you have 10 searches available this month
Type the Phrase in the Appropriate Search Engine and Answer the Question
Click on Next Term
Click Logoff at any time to save your session if you cannot finish in one    sitting

Actual result:
--------------
I would expect: (The 'X' is only there to show you the insertion point of the semicolon)

X
Hi jack you have 10 searches available this month
Type the Phrase in the Appropriate Search Engine and Answer the Question
Click on Next Term
Click Logoff at any time to save your session if you cannot finish in one    sitting

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-30 13:16 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2014-04-30 13:16 UTC] ab@php.net
What are you trying to achieve with this?

echo $$tableheader;
 [2014-04-30 21:11 UTC] jcmartin70 at hotmail dot com
-Status: Feedback +Status: Open
 [2014-04-30 21:11 UTC] jcmartin70 at hotmail dot com
Its just $tableheader, the extra dollar sign was a typo, sorry. The problem is where the 'X' is. I am getting a semicolon out of nowhere. Heredoc via ajax
 [2014-05-01 18:18 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2014-05-01 18:18 UTC] aharvey@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

I can't reproduce this with the code you've provided: http://3v4l.org/sF9EK

I would strongly suspect that the semicolon is coming from somewhere else in your code and is just appearing there due to a quirk in your styling.
 [2014-05-12 11:33 UTC] ab@php.net
-Status: Feedback +Status: No Feedback
 [2014-05-12 11:33 UTC] ab@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 17:01:31 2024 UTC