php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26995 short_open_tag = Off has no effect
Submitted: 2004-01-21 12:38 UTC Modified: 2004-03-23 18:19 UTC
Votes:6
Avg. Score:3.7 ± 0.9
Reproduced:3 of 5 (60.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: trobinson at gksystems dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5CVS-2004-01-27 OS: windows
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: trobinson at gksystems dot com
New email:
PHP Version: OS:

 

 [2004-01-21 12:38 UTC] trobinson at gksystems dot com
Description:
------------
php.ini contains the line:
  short_open_tag = Off

phpinfo() reports that it is off.

Yet <? short tags are still being processed.

This causes problems for <?xml, forcing the ugly workaround.

Reproduce code:
---------------
The next line should never say "short_open_tag: 0"
<br>
<?   
echo 'short_open_tag: ', (int) ini_get('short_open_tag');
?>


Expected result:
----------------
===EITHER===

The next line should never say "short_open_tag: 0" 
short_open_tag: 1

(if short_open_tag = On)

===OR===

The next line should never say "short_open_tag: 0" 


(in this case, the <? echo ...?> is visible in Reveal Source, but the browser correctly hides it.)


Actual result:
--------------
The next line should never say "short_open_tag: 0" 
short_open_tag: 0


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-21 14:52 UTC] sniper@php.net
Please check from phpinfo() output that you're loading the correct php.ini file.

 [2004-01-21 14:58 UTC] trobinson at gksystems dot com
phpinfo() reports the correct php.ini file.
However, regardless of php.ini setting, the following line should NEVER outout 0. It should either outout 1 or it should not execute at all.

<?= (int) ini_get('short_open_tag') ?>
 [2004-01-21 15:01 UTC] iliaa@php.net
what does var_dump(ini_get('short_open_tag')) say? 
 [2004-01-21 15:07 UTC] trobinson at gksystems dot com
var_dump(ini_get('short_open_tag'))

with short_open_tag = Off:

  string(0) ""

with short_open_tag = On:

  string(1) "1"
 [2004-01-23 02:03 UTC] sniper@php.net
Does it work when you run the script on command line?

 [2004-01-26 22:10 UTC] trobinson at gksystems dot com
c:\php> cli\php
<? var_dump(ini_get('short_open_tag')) ?>
^Z
string(0) ""

So same problem with CLI version.
I tried with 4.3.1 on the same machine, and it works correctly.
 [2004-01-27 15:57 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

I can't reproduce this..

 [2004-01-27 16:13 UTC] trobinson at gksystems dot com
I have duplicated the problem using CVS version PHP 5.0.0RC1-dev (cli) (built: Jan 21 2004 04:14:35)
and using php.ini-recommended, with just the short_open_tag line changed.
 [2004-03-15 10:09 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

There were some problems fixed recently which might have fixed this problem too. (although I'm still unable to reproduce this..)

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 09:01:27 2025 UTC