php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44655 > closes PHP script rather than ?>
Submitted: 2008-04-07 00:31 UTC Modified: 2010-12-20 12:31 UTC
From: william at ash dot id dot au Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.5 OS: Windows XP SPII
Private report: No CVE-ID: None
 [2008-04-07 00:31 UTC] william at ash dot id dot au
Description:
------------
I have two scripts that work fine on my website hosted by outside server. I installed to PHP on home computer for testing future scripts. The two scripts I do have use a > from a html tag within the PHP script to close the PHP script. There is no ? before the > so it should not do this. 

for some reason the PHP is terminating with the first > it comes across instead of needing a ?> - please help.

Modules that I installed with PHP 5.2.5 for Windows running Apache 2.2.8 are:
cvsclient, dio, docblock, event, EXIF, FDF, Fileinfo, GD2, Gettext, htscanner, pecl_http, id3, IMAP, Java, mailparse, Mimetype, MySQLi, ntuser, oggvorbis, OpenSSL, Operator, parsekit, PDFlib, phar, PHPDoc, POP3, Printer, sdo, Shared Memory, SMTP, SOAP, Sockets, Standard PHP, SQLite, ssh2, Tidy, threads, timezonedb, win32ps, win32schedule, win32service, win32std, zip and zlib_filter.

This problem occured before making any changes to my php.ini file - I have tried making changes to it to correct it but nothing I have done has made a difference.

I haven't done a backtrace yet as I am hoping that this isn't the first issue and I couldn't locate the bug relating to this and there is a simple answer - if a backtrace is needed please let me know.

Reproduce code:
---------------
Script that does cause the problem. 
<?php
echo '<p>This is PHP</p>';
echo '<p>This also is PHP</p>;
?>



Expected result:
----------------
This should output "This is PHP" and "This also is PHP" to the screen 


Fix implemented to make it work (below) - which won't help on complicated scripts so I would appreciate a fix!
<?php
echo '<p>This is PHP</p>
<?php
echo '<p>This also is PHP</p>

Actual result:
--------------
but it outputs 

This is PHP

'; echo '

This also is PHP

'; ?>


the > at the </p> on the first <p>...</p> html tag is closing the PHP script - it is identical problem on my other script - it's not actually the first > as there is one in the opening <p> tag - it's the one (>) after a closing </p> tag so I expect that the / (forward slash) might have something to do with it too!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-07 01:38 UTC] william at ash dot id dot au
Looks like I left the ' off my original script - I was cutting and pasting.

In the Reproduce Code: section
echo '<p>This also is PHP</p>; should have a ' between </p> and ;
like
echo '<p>This also is PHP</p>';
 [2008-04-07 12:06 UTC] jani@php.net
Your example has missing ' on line 3. No bug here.
 [2010-12-20 12:31 UTC] jani@php.net
-Package: Tidy +Package: Scripting Engine problem
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 13:01:31 2024 UTC