Author Topic: In PHP, objects are they passed by value or by reference?  (Read 57 times)

Makoo

  • Hero Member
  • *****
  • Posts: 725
  • Welcome to Digital Marketing Forum!
    • View Profile
Re: In PHP, objects are they passed by value or by reference?
« on: February 15, 2022, 08:14:33 am »
This is probably the most misunderstood PHP concept for people coming from other languages. A reference and a value are two completely different things. A reference is a memory address. A value can be of any type. Using the same terminology as we use for different types of pointers in C, here is how to distinguish between a reference and a value: -A ___ reference to an object is just a memory address (int). -A ___ object's value can be of any type (string, array, boolean, resource, etc.).

 

Digital Marketing Forum is a do-follow forum, post and discuss IT topics here and get dofollow signature. Discuss about SEO, SMO, Directory Submission, 301 redirection, robots, social bookmarking, Web design and development.