ZF-8520: Zend_Application_Resource_ResourceAbstract::setOptions kills array-element with key == (int)0
Description
I was writing a Resource where I was always missing the first option inside My_Application_Resource_Foo::init();
Some Code:
$options = array( array('someData'), array('someMoreData'), );
$resource = new My_Application_Resource_Foo($options);
$resource->init();
The problem is when $options is an array with numeric indizes the 0 always gets dropped because of this line:
if ('bootstrap' == $key) { unset($options[$key]); }
in Zend_Application_Resource_ResourceAbstract::setOptions()
because ('bootstrap' == 0) == true
using === instead of == fixed the problem for me:
if ('bootstrap' === $key) { unset($options[$key]); }
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2009-12-14T08:28:09.000+0000
Fixed in trunk.