Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Eclipse PHP: variable undefined when array
Eclipse PHP: variable undefined when array [message #1800455] Fri, 28 December 2018 18:21
Patrick Mising name is currently offline Patrick Mising nameFriend
Messages: 5
Registered: January 2010
Junior Member
I copied and pasted Example #1 from the documentation for "define".

I see an error that reads "Variable '$ANIMALS' is undefined" on the last echo line. This seems to happen whenever I try to reference a defined array. Am I doing something wrong? Is there some way to suppress this?

define("CONSTANT", "Hello world.");
echo CONSTANT; // outputs "Hello world."
echo Constant; // outputs "Constant" and issues a notice.

define("GREETING", "Hello you.", true);
echo GREETING; // outputs "Hello you."
echo Greeting; // outputs "Hello you."

// Works as of PHP 7
define('ANIMALS', array(
echo ANIMALS[1]; // outputs "cat"


This might be considered similar to:
Previous Topic:Windows firewall?
Next Topic:Timeout problem
Goto Forum:

Current Time: Thu Dec 08 21:08:26 GMT 2022

Powered by FUDForum. Page generated in 0.02339 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top