From:             singlarahul21 at gmail dot com
Operating system: Windows
PHP version:      5.2.3
PHP Bug Type:     Scripting Engine problem
Bug description:  Class static variables not parsed inside heredoc

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 bug report at http://bugs.php.net/?id=41776&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41776&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41776&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41776&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41776&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41776&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41776&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41776&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41776&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41776&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41776&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41776&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41776&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41776&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41776&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41776&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41776&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41776&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41776&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41776&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41776&r=mysqlcfg

Reply via email to