We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to pass a variable by reference in Zephir

How can i use Pass by Reference in zephir.

This is example PHP Code

    $a = 5; 
   $b =& $a; 
   $b = 6;

I can't find this in zephir docs.



98.9k

References are not currently supported by Zephir: https://github.com/phalcon/zephir/issues/203

Have a plan to support this feature?

References are not currently supported by Zephir: https://github.com/phalcon/zephir/issues/203



98.9k

We don't have plans to implement it soon as we don't use/need references in Phalcon 2, we'll happily merge that feature if someone in the community submits a pull request implementing it.

Ok.If this feature is not support in current time, how can i convert dot notation string to multidimensional array. Any idea?

eg :

"bar.baz.foo"
to
[bar][baz][foo]