way to turn off strict option? Use of undefined constant [message #177142] |
Thu, 23 February 2012 16:01 |
Paul
Messages: 3 Registered: February 2012
Karma: 0
|
Junior Member |
|
|
I installed a new version of PHP and now am getting errors on my pages
that say:
Notice: Use of undefined constant....
Is there any way in the page that I can add some code so I do not get
these errors? I just want to get this working and will go back and
fix this later.
But maybe there is a way like in VB a way to turn off Option
Explicit ?
thanks
|
|
|
Re: way to turn off strict option? Use of undefined constant [message #177143 is a reply to message #177142] |
Thu, 23 February 2012 17:21 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
.oO(Paul)
> I installed a new version of PHP and now am getting errors on my pages
> that say:
>
> Notice: Use of undefined constant....
>
> Is there any way in the page that I can add some code so I do not get
> these errors?
You can turn off notices (see error_reporting()), but the errors still
exist and you should fix them as soon as possible. The above for example
is the result of accessing an array element with an unquoted string key:
$foo = $array[bar];
Correct would be:
$foo = $array['bar'];
Micha
--
http://mfesser.de/blickwinkel
|
|
|
|
Re: way to turn off strict option? Use of undefined constant [message #177149 is a reply to message #177142] |
Thu, 23 February 2012 21:55 |
Peter H. Coffin
Messages: 245 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Thu, 23 Feb 2012 08:01:48 -0800 (PST), Paul wrote:
> I installed a new version of PHP and now am getting errors on my pages
> that say:
>
> Notice: Use of undefined constant....
>
> Is there any way in the page that I can add some code so I do not get
> these errors? I just want to get this working and will go back and
> fix this later.
>
> But maybe there is a way like in VB a way to turn off Option
> Explicit ?
Or you could, you know, define your constants...
--
Nay, God Himself will not save men against their wills. -Locke
|
|
|