#21956 [Opn->Bgs]: define constants not taking heredoc strings as value
ID: 21956
Updated by: nicos@php.net
Reported By: moptop69@ntlworld.com
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Win2k
PHP Version: 4.3.0
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Please read http://www.php.net/manual/en/function.define.php
it has
good nice examples on it.
Previous Comments:
------------------------------------------------------------------------
[2003-01-29 19:52:03] moptop69@ntlworld.com
when using define() to create constants, it all seems to work fine when
using standard strings.
However, under the definition for the arguments on define(), it says
that the define function can take string() as an argument.
looking at strings, heredoc is a valid string argument, however when
trying to define a constant as follows, the constant returns a null
string.
define($html_header, <<<THISISSTRING
the string goes here
THISISSTRING
);
if however you define a standard var like so:
$str_header=<<<THISISSTRING
the string goes here
THISISSTRING
;
then do:
define($html_header $str_header);
all works fine.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21956&edit=1
Thread (4 messages)