modifying a property of an object from a different class

Posted on 16th Feb 2014 by admin

I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance = new Distance($this->query, $this->distances);
and this property:
public $special = array();

in my Distance class, when it is created, it has a method that is run called "parse". In the parse method, I want to modify the property shown above in Math, and add values to that array. How can I do this?

Other forums