Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4267734
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:56:24+00:00 2026-05-21T06:56:24+00:00

This is something I needed to clear up awhile back. In PHP 5.3+, I

  • 0

This is something I needed to clear up awhile back. In PHP 5.3+, I wanted to ask if this improves performance on a very large array result? And do you have a way I can demonstrate the proof?

$synonyms = & MobyThesaurus::GetSynonyms("check");

Note the ampersand (by reference, instead of by value).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:56:25+00:00Added an answer on May 21, 2026 at 6:56 am

    PHP uses copy-on-write behind the scenes. Meaning, values are only copied when they’re altered. Until then there’s no copying going on and $synonyms basically acts as a reference anyway. If you’re only ever reading from the array, there should be no difference in performance.

    Once you are writing to the array, it does make quite a bit of difference in functionality whether the variable is a reference or not. Don’t use references unless you mean to, or you may introduce funky side effects into your app.

    There are a many optimizations going on behind the scenes, don’t expect to be able to optimize it any more with such “tricks”. PHP is the wrong language for being clever with pointer/reference acrobatics. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is something that I think would be very useful. Basically, I'd like there
I posted this question last week, but I wasn't very clear on what was
Doug McCune had created something that was exactly what I needed ( http://dougmccune.com/blog/2007/05/10/analyze-your-actionscript-code-with-this-apollo-app/ )
Something like var life= { users : { guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls
This is something I've pseudo-solved many times and have never quite found a solution
This is something simple I came up with for this question . I'm not
This is something that I always find a bit hard to explain to others:
This is something I've always wondered, and I can't find any mention of it
This was something originally discussed during a presentation given by Charles Brian Quinn of
This is something that I have never fully grasped in .NET as to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.