Re: PHP5 bloats the code

From: Date: Sat, 24 Apr 2004 17:02:51 +0000
Subject: Re: PHP5 bloats the code
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-184527@lists.php.net to get a copy of this message
Hi Curt, thank you for pointing this one out. Who are the "php internals" and how could i contact them? This issue was rejected as bug recently. - Johannes
* Thus wrote Marek Kilimajer (kilimajer@webglobe.sk):
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


« previous php.general (#184527) next »