Month: October 2009

  • PHP: self and clone

    I recently had to make a PHP class (let’s call it “class_A”) which returned an array of itself (to return multiple search results). All well and good and I used “$object=new self();” to do so like this: class class_A { public $setting; public function doSomething() { $toReturn=Array(); for ($i=1;$isetting=$i; Array_push($toReturn,$object); return $object; } } Calling […]