Hi,
As you surely know, arrays are often badly initialized:
<?php
// $array is undefined
$array['index'] = 'value';
?>
Wouldn't it be such a good thing to let the programmers know that this
is a bad habit, by throwing a +/- pedantic error ? I'm not sure which
type would suit for it, but I think its important enough to throw a
E_NOTICE.
It can be dangerous if the script is ran on an environment where
register_globals is enabled.
I wrote a paper about this kind of leak if you can't imagine an example:
http://www.colder.ch/news/09-04-2005/4/another-example-showing-t.html
Thanks for your interrest
--
Etienne Kneuss
I agree. I've always found it weird that no notice is thrown in this
situation. Still I discourage people to code like this.
Ron
"Etienne Kneuss" colder@php.net wrote in message
news:431ACE6C.3060006@php.net...
Hi,
As you surely know, arrays are often badly initialized:
<?php
// $array is undefined
$array['index'] = 'value';
?>Wouldn't it be such a good thing to let the programmers know that this
is a bad habit, by throwing a +/- pedantic error ? I'm not sure which
type would suit for it, but I think its important enough to throw a
E_NOTICE.It can be dangerous if the script is ran on an environment where
register_globals is enabled.
I wrote a paper about this kind of leak if you can't imagine an example:
http://www.colder.ch/news/09-04-2005/4/another-example-showing-t.htmlThanks for your interrest
--
Etienne Kneuss
As you surely know, arrays are often badly initialized:
<?php
// $array is undefined
$array['index'] = 'value';
?>Wouldn't it be such a good thing to let the programmers know that this
is a bad habit, by throwing a +/- pedantic error ? I'm not sure which
type would suit for it, but I think its important enough to throw a
E_NOTICE.I agree. I've always found it weird that no notice is thrown in this
situation. Still I discourage people to code like this.
This was brought up about a year ago and dismissed.
-Sara
Sara Golemon wrote:
As you surely know, arrays are often badly initialized:
<?php
// $array is undefined
$array['index'] = 'value';
?>Wouldn't it be such a good thing to let the programmers know that this
is a bad habit, by throwing a +/- pedantic error ? I'm not sure which
type would suit for it, but I think its important enough to throw a
E_NOTICE.I agree. I've always found it weird that no notice is thrown in this
situation. Still I discourage people to code like this.This was brought up about a year ago and dismissed.
No reason to not bring it up again.
Sebastian