It's standard practice to define/check variables or array keys for existence 
before testing or calling them - in any language.
The fact that PHP has 'let you away with it' by removing the NOTICE or WARNING 
error reports doesn't mean it's been acceptable, or recommended practice.

PHP 5.3 implements a lot that will appear in the release of PHP6.
PHP6 is moving to standardize, and clean up the language - including removing 
all the 'bad/lazy habits' that a lot of people have. 

Think of 5.3 as preparation for PHP6 - and an opportunity to rid yourself of 
those bad habits ;)

~ C


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of 
Michael
Sent: Wednesday, 16 September 2009 1:14 p.m.
To: [email protected]
Subject: [phpug] Re: PHP 5.3.0 error


On Wed, 16 Sep 2009 13:02:38 Nathan Kennedy wrote:
> Ok, no worries.
>
> What is happening on the line that is returning the error?
>
> If it's doing something like:
>
> $value = $_GET['retry'];
>
> Then you might want to try something like:
>
> $value = array_key_exists('retry',$_GET)?$_GET['retry']:null;
>
> Which will not return that notice.

The question is WTH were they thinking?

PHP 5.3.0 seems to break quite a few things, and certainly what's wrong with 
referring to variables as $_GET["variable"] ?

That's what all the books and online guides teach.



--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to