php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48760 <?= no longer prints output
Submitted: 2009-07-01 20:25 UTC Modified: 2009-07-01 20:36 UTC
From: scottq at iserve dot net dot nz Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.3.0 OS: CentOS 5.3
Private report: No CVE-ID: None
 [2009-07-01 20:25 UTC] scottq at iserve dot net dot nz
Description:
------------
In php versions up to 5.3.0RC4 <?= 'output'; ?> would print the word output to the screen. As of 5.3 this no longer works, instead outputs chunks of code to the screen.



Reproduce code:
---------------
class action {
  private $request = array('foo' => 'bar');

  public function getRequest($key, $default) {
    return isset($request[$key]) ? $request[$key] : $default;
  }
}

... some other stuff...

$array = ('key' => array('bar' => array('value' => 'foo')));

<?= 'output'; ?>
<?= $array['key'][$action->getRequest('foo', NULL)]['value']; ?>

Expected result:
----------------
output
bar

Actual result:
--------------
action-&gt;getRequest('foo', NULL)]['value1']; ?&gt;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-01 20:30 UTC] rasmus@php.net
Unable to reproduce.  You probably don't have short_open_tag turned on in your config anymore.
 [2009-07-01 20:36 UTC] scottq at iserve dot net dot nz
Sorry, <?= 'output'; ?> doesn't get picked up by php at all.

The "action-&gt;getRequest('foo', NULL)]['value1']; ?&gt;" was coming from by browser.  It simply outputs "<?= 'output'; ?>".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 22:01:28 2024 UTC