Bu kodu:
<?php
class Foo
{
    var $value;
    function foo($value)
    {
        $this->setValue($value);
    }
    function setValue($value)
    {
        $this->value=$value;
    }
}
class Bar
{
    var $foos=array();
    function Bar()
    {
        for ($x=1; $x<=10; $x++)
        {
            $this->foos[$x]=new Foo("Foo # $x");
        }
    }
    function getFoo($index)
    {
        return $this->foos[$index];
    }
    function test()
    {
        $testFoo=$this->getFoo(5);
        $testFoo->setValue("My value has now changed");
    }
}
?>
Yöntemi Bar::test() çalıştırılır ve foo nesnelerin dizi foo # 5 değerini değiştirdiğinde, gerçek foo dizideki 5. etkilenecek, ya da olacak $testFoo değişken fonksiyonunun sonunda ortadan kalkıncaya olur sadece yerel bir değişken olabilir mi?