Elance Exams Answers PDF file

-- PDF FILE --
Download PDF file of elance Zoho Creator Exam Answers
elance-zoho-creator-exam.pdf

What is wrong with the following code? <?php function duplicate($obj) { $newObj = $obj; return $newObj; } $a = new MyClass(); $a_copy = duplicate($a); $a->setValue(10); $a_copy->setValue(20); ?>

There is nothing wrong with this code
You must use return &$newObj instead
duplicate() must return a reference
You must use the clone operator to make a copy of an object
Top
  • Follows us our servcies
  • Facebook icon
  • Linkedin icon
  • twitter icon
  • rss icon
  • social icon