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

Return pointer in Array access operator #459

Open
danielelidio opened this issue Oct 22, 2020 · 0 comments
Open

Return pointer in Array access operator #459

danielelidio opened this issue Oct 22, 2020 · 0 comments

Comments

@danielelidio
Copy link

danielelidio commented Oct 22, 2020

Hey, Thanks for this awesome project! This is saving my life hehe!

I have this portion of code.

jsonObj[myKey] = Php::Array();
jsonObjPointer = (Php::Array *) &(jsonObj[myKey]);

This code returns error error: taking address of temporary [-fpermissive]

I did check PHP-CPP source code in value.h and may be I'm wrong but it seems that Array access operators are returning copy of the value. Is there a way to make myjsonObj[myKey]return a reference to the value?

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

1 participant