From: mrfroasty on
<?php
class A{

public function someFunction()
{
$obj = new B();
//add more to $obj_A
$obj->data = "B foo";

//call a function to add extra info on $obj_A
$obj = $this->addExtraInfo($obj);

//debug
print_r($obj);
echo "<br />";

}

public function addExtraInfo($obj)
{
$obj->recs = "B bar";
return $obj;
}
}

class B
{
public $data;
public $recs;
public function __construct()
{

}
}

//test
$testObj = new A();
$testObj->someFunction();
?>

<?php
class C{

public function someFunction()
{
$obj = new D();
//add more to $obj
$obj->data = "D foo";

//call a function to add extra info on $obj
$this->addExtraInfo($obj);

//debug
print_r($obj);
echo "<br />";

}

public function addExtraInfo(&$obj)
{
$obj->recs = "D bar";
}
}

class D
{
public $data;
public $recs;
public function __construct()
{

}
}

//test
$testObj = new C();
$testObj->someFunction();
?>
From: Jim Lucas on
mrfroasty wrote:
>
> //NOTHING!!!//
>

Well Mr. Froasty, was there a point to your email or do you always send empty
emails with random files attached to them to list the list? Was their suppose
to be a question along with that email? You simply forgot to add it?

--
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
 | 
Pages: 1
Prev: Generic Email
Next: Question - foreach.