I have a set of PHP functions that I want to move into a new class. One of the functions is using &$obj in an argument to modify the original object:
function process_new_place_names(&$obj)
any changes made to $obj in this function are passed back to the script.
Question is, can I do this inside a PHP class too? Also, what is the terminology of this approach?
You can absolutely do this inside of classes. It’s known as passing by reference.
Further reading:
http://php.net/manual/en/language.references.php
http://php.net/manual/en/language.oop5.references.php