[TYPO3-core] RFC: is_array check extension manager

Oliver Hader oh at inpublica.de
Wed Aug 15 10:25:16 CEST 2007

Hi Franz,

Franz Holzinger schrieb:
> Michael Stucki writes:
>> No because he loops over $conf['constraints']['conflicts'].
>> $conf['constrains'] can be an array while still there might be no
>> $conf['constraints']['conflicts']! So checking this first using isset
>> is the only right thing to do.
>> Please double-check such tiny issues before writing to this list.
> I see no sense in this to check isset anded with is_array. If it is an
> array it must be also be set. So the first parameter is redundant.
> See php.net
> bool is_array ( mixed $var )
> Finds whether the given variable is an array.
>>> if (isset($conf['constraints']['conflicts']) &&
>>> is_array($conf['constraints']['conflicts'])) {

Have you tested this without disabling PHP warnings?! The isset() works
even if the element to check isn't defined - returns false but no
warnings. As Michael mentioned before, please double check and test such
basic issues before posting to the Core-List. Thanks!

The isset($array['key']) && is_array($array['key']) is the correct way!

Oliver Hader

More information about the TYPO3-team-core mailing list