#21956 [Opn->Bgs]: define constants not taking heredoc strings as value

From: Date: Fri, 07 Feb 2003 13:26:48 +0000
Subject: #21956 [Opn->Bgs]: define constants not taking heredoc strings as value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32383@lists.php.net to get a copy of this message
 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)

« previous php.bugs (#32383) next »