ZF-8520: Zend_Application_Resource_ResourceAbstract::setOptions kills array-element with key == (int)0

Issue Type: Bug Created: 2009-12-10T21:11:25.000+0000 Last Updated: 2009-12-14T08:28:13.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Benjamin Steininger (robo47) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application_Resource

Related issues: Attachments:


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);


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]); }


Posted by Matthew Weier O'Phinney (matthew) on 2009-12-14T08:28:09.000+0000

Fixed in trunk.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.