0

i would like to ask how to convert: method(Class1::Class2 &class); in php? what should i write: me->method(????)

hx. appreciate

I am working in c__/ubuntu.

1

1 Answer 1

1

The same way:

function method(&$variable)

However, if &class is an object, it's not necessary - since PHP 5, objects are automatically passed as reference. a kind of references in themselves, so this isn't necessary.

Sign up to request clarification or add additional context in comments.

2 Comments

Nitpicking on "passed as reference": docs.php.net/manual/en/language.oop5.references.php ;-)
i am trying to create a php extension. How to convert this?stackoverflow.com/questions/7384848/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.