Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Phalcon\Config::offsetUnset() does not work #732

Closed
ghost opened this issue Jun 27, 2013 · 1 comment
Closed

[BUG] Phalcon\Config::offsetUnset() does not work #732

ghost opened this issue Jun 27, 2013 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 27, 2013

Test case:

$x = new Phalcon\Config(array('a' => 0));
echo $x['a'], "\n";
unset($x['a']);
echo $x['a'], "\n";

Actual result:

0
0

Expected result:

0
PHP Notice:  Undefined property: Phalcon\Config::$a
@ghost
Copy link
Author

ghost commented Jun 27, 2013

The only idea that comes to mind is

@@ -309,6 +309,11 @@ PHP_METHOD(Phalcon_Config, offsetUnset){
        zval *index;

        phalcon_fetch_params(0, 1, 0, &index);
+#if PHP_VERSION_ID < 50400
+       Z_OBJ_HANDLER_P(getThis(), unset_property)(getThis(), index TSRMLS_CC);
+#else
+       Z_OBJ_HANDLER_P(getThis(), unset_property)(getThis(), index, 0 TSRMLS_CC);
+#endif

        RETURN_TRUE;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants