Hacker News new | ask | show | jobs
by pbiggar 5088 days ago
PHP has references, because once upon a time it didn't have pointers. If the only way to pass pointers is by value, then you are severely limited. So it got references, following (I assume intentionally) Perl's syntax and semantics, though with its own reference counting foibles.

Then it got pointers, and references suddenly weren't needed that much anymore. But it kept the old semantics, and still needs references for passing arrays around, since arrays are not objects, and PHP assignment is still by copy.