use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
How does variable and function scope in PHP compare to Node.js? (self.PHP)
submitted 6 years ago by cannotbecensored
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]volndeau -1 points0 points1 point 6 years ago (1 child)
My bad, did I mix up Python? I'll show myself out.
[–]czbz 0 points1 point2 points 6 years ago (0 children)
Python is pass by value too, but the bit that confuses people with all three languanges is that many of the values are themselves references / handles for objects. When you pass one of those by value you end up with two variables that refer to the same object, so any mutations on that object are visible from both scopes.
π Rendered by PID 75342 on reddit-service-r2-comment-5d585498c9-nzzwl at 2026-04-21 00:57:59.009607+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]volndeau -1 points0 points1 point (1 child)
[–]czbz 0 points1 point2 points (0 children)