In PHP, are objects passed by value or by reference?

  • By value
  • By reference
  • Depends on the scenario
  • Both options are valid
In PHP, objects are passed by value. When you assign or pass an object to a variable or a function, a copy of the object is created. Learn more: http://php.net/manual/en/language.oop5.references.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *