Re: Bug #3623: PHP fails to interpret included or required array declaration and init.
| From: | Flavien LEBARBE | Date: | Fri, 25 Feb 2000 18:25:55 +0000 |
| Subject: | Re: Bug #3623: PHP fails to interpret included or required array declaration and init. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-16006@lists.php.net to get a copy of this message | ||
This is _NOT_ a bug ! :-)
You need to have the code in included files surrounded by
tags too :
<?php
$myarray=array( // <== NOTICE 'array'
"a" => "apple",
"b" => "banana",
"c" => "cherry"
);
?>
Flavien Lebarbé
--
Open Care.
chris@claimlynx.com wrote:
>
> From: chris@claimlynx.com
> Operating system: FreeBSD3.3
> PHP version: 3.0.12
> PHP Bug Type: Parser error
> Bug description: PHP fails to interpret included or required array declaration and init.
>
> Using Apache 1.3.9 module version of PHP.
>
> In an HTML web page, the following simply displays the actual text of the PHP code instead of
> it being interpreted. If included/required code is added inline in same file, it works fine.
>
> In test.php3:
> <?php
> include "$DOCUMENT_ROOT/arrayinit.inc";
> // -OR-
> require "$DOCUMENT_ROOT/arrayinit.inc";
> ?>
>
> In arrayinit.inc:
> // init my array
> $myarray = (
> "a" => "apple",
> "b" => "banana",
> "c" => "cherry"
> );