Hacker News new | ask | show | jobs
by chrisguitarguy 4786 days ago
> So it's like PHP where I need to pass in `function modify(&$foo) {` to modify a variable passed by reference.

If you're thinking in terms of PHP's primitive types, then yes: that's probably the best equivalent. PHP has the whole objects always being "passed by reference" [0] thing going on too.

0. http://php.net/manual/en/language.oop5.references.php