RE: [PHP-DEV] Bug #3623: PHP fails to interpret included or required array declaration and init.
| From: | Chris Johnson | Date: | Fri, 25 Feb 2000 22:29:14 +0000 |
| Subject: | RE: [PHP-DEV] 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-16018@lists.php.net to get a copy of this message | ||
Sorry, that was a typographical error I made when typing my code into
your bug reporting web window. The actual code DOES have an array()
operator.
..chris
> -----Original Message-----
> From: lbb@ocare.com [mailto:lbb@ocare.com]On Behalf Of Flavien LEBARBE
> Sent: Friday, February 25, 2000 12:26 PM
> To: chris@claimlynx.com
> Cc: php-dev@lists.php.net
> Subject: Re: [PHP-DEV] Bug #3623: PHP fails to interpret included or
> required array declaration and init.
>
>
> 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"
> > );
>