Examveda
Examveda

Which keyword must be added before $first variable on the third line of the above question to make $second and $first as distinct objects in PHP 5?

A. copy

B. clone

C. cut

D. Can’t add any word to make them distinct

Answer: Option B

Solution(By Examveda Team)

Clone operates on an object instance, producing a by-value copy.

This Question Belongs to PHP >> Object Oriented Concept

Join The Discussion

Related Questions on Object Oriented Concept