#16838 [Ana->Bgs]: PHP short_open_tags and <?xml .. ?>

From: Date: Wed, 09 Oct 2002 03:07:53 +0000
Subject: #16838 [Ana->Bgs]: PHP short_open_tags and <?xml .. ?>
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-21884@lists.php.net to get a copy of this message
ID: 16838 Updated by: iliaa@php.net Reported By: sloetz@web.de -Status: Analyzed +Status: Bogus Bug Type: Scripting Engine problem Operating System: all PHP Version: 4.2.0 New Comment: 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 There are currently 2 ways you can avoid this issue: 1st and probably the best is to disable short_tags. For people writing distributable apps it is a must, since not every user configures their PHP with short_tags on. 2nd solution involves incasing the <xml tag within a php echo , like this: echo '<?xml>'; If you do not believe that this is the correct behaviour review many previous threads on php-dev mailing list on this issue for more reasons as to why this is done the way it is. If you feel you have something new to add on this matter, please do so on php-dev mailing list. Previous Comments: ------------------------------------------------------------------------ [2002-09-13 08:01:57] mfischer@php.net No, a global fix is not on the ways; not in the near future. As advised, please consult the php-dev@ archive at marc.theaimsgroup.com for discussion and background why it's not changing soon. Feel free to discuss this on php-dev@lists.php.net (more developers will probably read it). ------------------------------------------------------------------------ [2002-09-13 07:46:52] roland.lichti@mediaways.net Is there any chance to get this problem fixed? Even in 4.2.2 this bug isn't fixed. together with another bug (when short_open_tags is enabled EVERY file is parsed) this bug is now really annoying. ------------------------------------------------------------------------ [2002-04-26 15:02:54] proprietor@pp4.de We shortly stumbled into that 'problem', too. Actually a contractor of ours did, that is. - We are sending everything through php, even static html. We do not have much, kiss (keep is stupid simple) and there some statistics reasons. - We host several loosely relatd sites, for clients who sometimes (let) code on their own; we add to theis sites, some other stuff is directly outsourced by us. - a young employee of one of our contractors recently approached me with a nicely made several-pages paper demonstrating a "bug in he server" ! Yes alas, he tried to use xml, clashed with php short tags, and here you go! He had no real knowledge of php at all, and he did not know we were using it, anyways. - I scanned our site for short tags: Found many. I tried to auto-replace them with long tags: many sites did not work any more. I tried to also replace "<?=" with "<?php echo" and it also did not work :-( - I ran a q&d count against our web sites & found roughly as many "<?" as ("<?[:whitespace:]" plus "<?=" plus "<?php") so => I propose to add an option to the php.ini that restricts short tags to ones like "<?" followed by whitespace or followed by "=" and leaves everything else alone. Pu <proprietor@pp4.de> ------------------------------------------------------------------------ [2002-04-26 11:43:24] sniper@php.net Only good solution is to get rid of the short tags. It only saves you 3 keystrokes.. ------------------------------------------------------------------------ [2002-04-26 11:41:25] sniper@php.net Only good solution is to get rid of the short tags. It only saves you 3 keystrokes.. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/16838 -- Edit this bug report at http://bugs.php.net/?id=16838&edit=1

« previous php.bugs (#21884) next »