ID:               41776
 User updated by:  singlarahul21 at gmail dot com
 Reported By:      singlarahul21 at gmail dot com
 Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: Windows
 PHP Version:      5.2.3
 New Comment:

Update: It seems like class static variables are not parsed inside any
quoted string. And because heredoc is practically a quoted string, they
are not parsed inside heredoc too!!!


Previous Comments:
------------------------------------------------------------------------

[2007-06-22 05:53:24] singlarahul21 at gmail dot com

Description:
------------
A class static variable is not recognized & parsed inside heredoc.
Instead the class name & scope resolution operator is passed in the
string variable & the static variable name is tried to be parsed as a
Independent local variable.

Reproduce code:
---------------
<?php
   class config
   {
      public static $Image="/images";
   }

   class layout
   {
      public function writeLogo()
      {
         $text = <<<ABC
            <img class="Logo" title="My Logo" alt="Logo"
src="{config::$Image}/Logo.gif" />
ABC;

         echo($text);
      }
   }

   $sample = new layout();
   $sample->writeLogo();
?>

Expected result:
----------------
I expect the following tag to be outputted:

<img class="Logo" title="My Logo" alt="Logo" src="/images/Logo.gif" />

Actual result:
--------------
<img class="Logo" title="My Logo" alt="Logo" src="config::/Logo.gif" />


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41776&edit=1

Reply via email to