Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: ArrayObject vs array Date: Mon, 26 Jul 2021 12:16:44 +0200 Lines: 39 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net OWeWuzkCfN4J1Vv85l5lawQ72qIMfi8SjFeDXYJGnBNPkn+/Hp Cancel-Lock: sha1:CxpkXAPCAjCYlmh8ErYb94zk8rc= In-Reply-To: Xref: csiph.com comp.lang.php:18754 alex: > Il 25/07/21 11:48, J.O. Aho ha scritto: >> >> You can make objects to have links to other objects (reference), > > That is? setName('foobar'); // This will return the same name wich was just set using $b since // $b is just another reference to the object originally assinged to $a $a->getName(); ?> If you need a copy of an object, you need to use the "clone" keyword: -- Arno Welzel https://arnowelzel.de