* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
> I just installed php5 (finaly :-)) and it does not throw any error nor
> warning. I think what you see is Notice, so the behavior did not change.
Here is the offending situation:
<?php
/* E_NOTICE: undefined index, returns false */
unset($a);
echo is_array($a['foo']['asdf']);
/* returns false */
$a = 'asdf';
echo isset($a['foo']['asdf']);
/* returns false */
$a = array('foo' => 'asdf');
echo is_array($a['foo']['asdf']);
/* E_ERROR Invalid offset */
$a = 'asdf';
echo is_array($a['foo']['asdf']);
The last one is the biggie, the solution of course is to have
something like:
if (isset($a['foo']['asdf']) &&
is_array($a['foo']['asdf']) {
This is a big BC issue, IMO, and might be worth asking internals
why the E_ERROR is given vs. a E_WARNING.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php